My question1 asks the user to identify the asset id. That works beautifully:
Then I have a note that needs to display the work order number based on the asset id. It runs the following calculation:
Is the where clause supposed to allow for inclusion of variables, i.e. values from previous questions?
If I hard-code the value in the where clause then the pulldata function returns the correct value. The documentation doesn't clarify if variables are supported, and Esri's Survey123 Connect samples don't show it either.
Solved! Go to Solution.
Is the ManholeID a number or text? If text, the Manhole ID must be enclosed with quotes.
pulldata("@layer", "getValue", "<json_path>",<url>, concat("MANHOLE_ID='", ${question1},"'"))
Did you try this?
pulldata("@layer", "getValue", "<json_path>",<url>, concat("MANHOLE_ID=", ${question1}))
Still no luck. I've tried using a variable in the where clause in all kinds of ways, never gotten it to work.
I appreciate the quick reply.
When I enter my pulldata request in the above format, I get the following syntax error in my text box:
call in my xlsForm: pulldata("@layer", "getValue", "attributes.scientific","https://services1.arcgis.com/KNdRU5cN6ENqCTjk/arcgis/rest/services/PlantList/FeatureServer/0",concat("name='",${PlantCommon},"'"))
PlantCommon is a dropdown of common names
The error may have been fixed in a later survey 123 release. I just downloaded 3.18 and it works in the sample form "Query a Feature Layer" like it should, but in my own environment the wrong value is returned inconsistently. Sometimes the correct value is returned, and sometimes the correct value appears for a brief second and then changes to the same incorrect value first record in the table. I am out of ideas.
Hey Joshua,
Did you ever get this syntax error figured out? I'm running into the same problem with my pulldata(@layer...) calculations.
Unfortunately, no. But because my list was not going to grow much larger than 250 items, I added it to the survey itself without taking a hit to performance.
Is the ManholeID a number or text? If text, the Manhole ID must be enclosed with quotes.
pulldata("@layer", "getValue", "<json_path>",<url>, concat("MANHOLE_ID='", ${question1},"'"))
Perfect! That did it. I can't believe I didn't catch that myself. Thank you for the quick replies, Ismael, you and the Survey123 team are the best. Much appreciated.