Use answer from question to populate another field.

573
1
12-13-2017 02:45 PM
AshleyHayes2
New Contributor III

Let's say (using a simple example) I am interested in having 1 field that I can use for pop-ups, queries, etc..  In this example, the field is PLU_Code (the number on the little stickers that come on the fruits and veggies at the grocery store).

I could set up a survey that directly asks the PLU Code and that would be simple, but let's say the cashiers do not have the PLU Codes memorized.  So instead, I ask a series of questions that narrows down the produce type until the PLU Code is determined.  

For example, 1) Type of produce? ("Fruit" is chosen); 2) Color of fruit? ("Yellow" is chosen); 3) Type of yellow fruit? ("Banana" and "Lemon" are choices); and if "Lemon" is chosen, then 4) Organic Lemon or Non-Organic Lemon?  

Can I set up my survey so that if the answer to question #3 is "Banana" then PLU_CODE is assigned a value of "4011" for banana?  Or if the answer to #4 is "Non-Organic Lemon", then PLU_CODE is assigned a value of "4033" for non-organic lemon?  

This way, for pop-ups and queries, I can just look at the PLU_CODE field and I don't have to somehow look at the values of a huge combination of fields (ex. ProduceType = 'Fruit', FruitColor = 'Yellow', VegetableColor = '', OrangeFruit = '', YellowFruit = 'Banana', RedFruit = '', etc.).

Thanks!!    

0 Kudos
1 Reply
by Anonymous User
Not applicable

Hi Ashley,

Yes you can achieve the workflow you have described using cascading selects and external choice lists, or alternatively using the pulldata() function with CSV files in the media folder containing the combinations of choices. The key to success is having all the combinations of types, fruits and colours mapped to the PLU codes. You may also need to use some IF statements in the calcaultions to further narrow down choices if there are multiple possibilities of similar items, or the same PLU code is used for different types or fruits.

More info can be found here for cascading selects: https://community.esri.com/groups/survey123/blog/2015/10/22/cascading-selects-and-external-selects 

And here for pulldata(): https://community.esri.com/groups/survey123/blog/2016/10/27/the-pulldata-function-access-external-da... 

Further information can be found in the Survey123 documentation: Survey123 for ArcGIS | ArcGIS 

Hope this helps.

Regards,

Phil.

0 Kudos