Survey123 Use pulldata from previous question for choice filter

834
1
07-14-2021 12:10 PM
NathanialWigington
New Contributor

I have a form that uses the pulldata() function to create a JSON from hosted feature layer in my AGOL account. I then use the pulldata() function again to populate two subsequent questions from the JSON script, which works great.

The issue I have is trying to use a choice_filter based on the values from one of the previous questions that used the pulldata() in the calculation field. I am not getting any choices in the drop down. When I don't use the pulldata() function in the other questions, and just use the select_one then I am able to get this to work.

0 Kudos
1 Reply
Jim-Moore
Esri Regular Contributor

Hi @NathanialWigington 

Thanks for including your XLSForm. The selected() function you've used for the choice filters relies on the choice name (i.e. the value of the choice), not the choice label. Looking at the feature layer, it looks like UNITNAME corresponds to the labels in your Park_Name choice list, whereas ENTITYID looks like it corresponds to the choice names. Changing the pulldata() for the Park_Name question to reference attribute.ENTITYID instead should help.

For MGTUNTIID, in the feature layer many of the values have a mix of upper- and lowercase letters, whereas in you choice list (and the MU column for the choice filter) they are all uppercase. Note that the choice names are case sensitive; so changing these to match exactly what's in the MGTUNTIID field should fix the Work_Order question.

Hope this helps. Best, Jim

0 Kudos