We want to use the community name to look up Latitude/Longitude coordinates.
Lookup table: WMAT_GPS
Column in lookup table to match: Comm_ID
Value in form that links to lookup table: y_community_reside
Columns in lookup table to save: Latitude, Longitude
Below is my attempt at the code for the hidden value question, but I'm getting an error message. Can you help me figure out where I went wrong?
In your case, you likely want something like this (assuming #form/index corresponds to your Comm_ID: instance('WMAT_GPS')/WMAT_GPS_list/WMAT_GPS[Comm_ID = #form/y_community/y_community_reside]/Latitude instance('WMAT_GPS')/WMAT_GPS_list/WMAT_GPS[Comm_ID = #form/y_community/y_community_reside]/Longitude
Note that the comparison within the brackets serves as a filter on the lookup table, limiting the results to only those rows in WMAT_GPS whose Comm_ID corresponds to y_community_reside. Once filtered, you then add the reference to the particular column that you want to access.
This is quite a bit more technical than the Confluence documentation, but you can read more about XPath evaluation here if you're curious!