Show a field and then prepopulate from another field

247
3
12-05-2019 08:01 AM
CN
by
New Contributor III

We currently are working with a number of customers who want to launch 1 or more survey123 forms from Collector and when the form is launched prepopulate certain fields.  We accomplished this relatively quickly by building Arcade expressions in the collector webmap around the custom survey123 URL structure.  However, i've been struggling to find a way to prepopulate fields but not show them until a condition is met.  For example, if a checkbox is checked show a field with the prepopulated value.  I've been told by Esri support that one can't use relevant logic on a prepopulated field for the field does not prepopulate if the relevant logic such as ${checkbox}='yes' is used.  So i was hoping an alternative could be to prepopulate hidden fields and then somehow create logic to show a field and then populate that shown field from a hidden field.  Any assistance would be appreciated. Open to suggestions.  Thanks. 

0 Kudos
3 Replies
CN
by
New Contributor III

I should note that the survey123 prepopulated form field values come from ArcGIS online hosted feature layers we programmatically update multiple times per day.  

0 Kudos
DougBrowning
MVP Notable Contributor

I think you have the right idea.  Prepopulate a hidden field.  Then in the relevant field have a calculation that pulls in the hidden field.  The calculation should fire when the field becomes relevant.  Have you tried it?

0 Kudos
CN
by
New Contributor III

Thanks Doug.  Glad we were both on the same page.  I actually couldn't get it to work with logic only in the relevant field but i did get it to work (not sure if it is the best route or not).  In the email display field, i set the following in the relevant cell ${emloption}='Yes' so when the associated checkbox in the form was clicked it would show the display field. Directly adjacent in the same field (email display field) i set the following in the calculation field ${email_list} to pull from the hidden field and it worked.