Hi all,
I'm building a survey with a repeat in it. When specific criteria is met (in this case "female"), Survey 123 adds all the females to a list below the repeat (note field or table).
If male is selected, then the table or note is not updated with the name.
I'm not sure how to do this with the correct syntax and how to display multiple names Dynamically - when the female selection is selected. Please help.
See attached example survey.
Thanks,
Paul
Solved! Go to Solution.
Join only takes one argument join(separator, question). So try join("\n",${name}). If you search the board I think this was posted not too long ago. Not sure what the outcome was.
Formulas—Survey123 for ArcGIS | Documentation
Sorry I am not more help
Hi Paul
You can concatenate all answers for a question in a repeat using the join() function. Apologies if I've missed the objective here, but one way you might achieve this is to have a hidden question in the repeat that stores the name if 'female' is selected, using a calculation similar to: if(selected(${gender},'female'),${name},''). Then use the join() function outside of the repeat to concatenate the values for that question. Please see simple example attached.
For more info on functions, please see Formulas—Survey123 for ArcGIS | Documentation.
Hope this is of use!
Best,
Jim
Thanks Jim that works however, the names are not returned in a separate line. Is there a way to insert a carriage return in the code so each name is listed vertically? (when I have long names, they are spread across multiple lines.)
Thanks,
Paul
Correction - not vertically but horizontally in its own line.
I think someone posted that you can add a \n?
To confirm, this is done in the calculation field with the join, like this:
join(',',${name},"\n")
I understand the appearance must be set to multi-line, however this is not creating a new line in the form with the names on separate lines. (I'm just looking for the correct syntax).
Thanks,
Paul
Join only takes one argument join(separator, question). So try join("\n",${name}). If you search the board I think this was posted not too long ago. Not sure what the outcome was.
Formulas—Survey123 for ArcGIS | Documentation
Sorry I am not more help
As Doug suggests, "\n" should work in the field app. You might also want to try "<br>" as this should work in both the field app and the web app.
Thanks for your help Doug, it works with this: join("\n",${name})