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.
I was struggling with this, I feel like the fact it needs to be in a concat() with the quotes would be handy to include in your Tricks of the Trade blog about pulldata(@layer) or documentation somewhere. I had tried the style of "MANHOLE_ID= '${question1}'" with the single quotes directly and it didn't want to work which surprised me.
Thank you for the solution!
Well done.
Doesn't make any sense but this is key!
"MANHOLE_ID='hard coded text value'" works.
"MANHOLE_ID='${question1}'" does not work.
concat("MANHOLE_ID='", ${question1},"'") works.
Hello,
I have the same problem, I work with text and I use your code, no error appears but no value appears either.
pulldata("@layer","getValue","attributes.perfil_professional","URL",concat("nom_ramader='", ${nom_ramader},"'"))
The Featre layer permits queries, can you help me?
Much appreciated.;)
I can't see anything that seems off really, the only thing I'd say is make sure everything is spelt matching, and case matching as well! (Upper vs lower case letters).
The only other difference I see with yours compared to mine is I used single quotes around my variables instead of double quotes.
Hi Ismael,
How can I add two conditions. ex.: id=123 and name="xyz"
Hope to hear soon.
Best,
Oussama
Dear Ismael,
I have managed to do it. "id="123 and "name='xyz'"
Best,
Oussama
Hi All,
Has anyone really made the pulldata@layer work? I have tried all the possibilities and even the sample code from ESRI does not work.
I upgraded to 3.18 but it keeps saying: TypeError: Cannot read property 'toString' of underfined in expression: pulldata("@layer",....)
This is an useful function, hope that it should work.
Thanks,
Lan
I was able to get it to work in 3.18, but not like the ESRI sample. I had to place the entire pulldata function into a single field. If I separated the concat and referenced it, pulldata retrieved the wrong record. @lannguyentl include your pulldata syntax and I bet someone can find the problem.
I am also struggling with pull data from feature layer. Can you share last solution that worked?