I have a collector app with a custom url (including an ID field) to open Survey123. The url opens the survey and the ID field is populated in my survey. I want to do a calculation on the ID field. Specifically, if the ID field contains a sub-string of 'xyz', I want to use the sub-string to reveal a group. I keep getting an error when I save the exel forms, is there a way around this?
Solved! Go to Solution.
Hi Melissa,
This is possible - you would need to have a calculation in the relevant column of the group that will hide/show based on the ID value. For a substring, you will want to use a regex function (see the Regular Expressions section of Formulas—Survey123 for ArcGIS | ArcGIS ); it will likely be something like
regex(${id_question}, '^.*xyz.*$')
Hi Melissa,
This is possible - you would need to have a calculation in the relevant column of the group that will hide/show based on the ID value. For a substring, you will want to use a regex function (see the Regular Expressions section of Formulas—Survey123 for ArcGIS | ArcGIS ); it will likely be something like
regex(${id_question}, '^.*xyz.*$')
Thanks James! Yes that worked. I was trying to do a sub-string calculation like this: substr(${id},5 ,3), in the calculation field, then in the group relevant field use if ${calculation_field}="xyz". Your suggestion worked right away. Thank you.