Need Help Troubleshooting Error When Referencing Lookup Tables

I set up a survey that pulls data from a variety of lookup tables (Images 1-3). I also created hidden values so that I can concatenate values from a certain instance to create a new variable that I can reference in case properties later (Images 4-5).

However, when I test the survey, I run into the following errors:

  1. Calculation Error: Error in calculation for /data/administration/locality_name XPath nodeset has more than one node [instance(locality_ma)/locality_ma_list/locality cannot convert multiple nodes to a raw value. Refine path expression to match only one node.

  2. Calculation Error: Error in calculation for /data/administration/communal_section_name XPath nodeset has more than one node [instance(comm__sectma)/comm__sectma_li cannot convert multiple nodes to a raw value. Refine path expression to match only one node.

Does anyone know why that might be? Any input regarding this would be much appreciated. Below are also the images referenced above for context. Thanks!

Image 1:

Image 2:

Image 3:

Image 4:

Image 5:

That error means that the query expression provided matches more than one element of your lookup table. My guess is that your lookup table might have overlapping id sets.

One easy way to see what might be happening is to replace the calculation expression in your locality_name hidden value with a joined value instead of a single value, like:

join(", ", instance("locality_ma")....)

That will make the hidden value show you all of the items that matched the ID.

You can also use the Data Preview feature in Live Preview to iterate on this faster. It'll let you provide a raw query and show you what it would output to.