Select to view content in your preferred language

join answers from repeat in outside note

3115
7
12-19-2019 02:15 PM
MilesMcCoy-Sulentic
Emerging Contributor

Is it possible to incorporate a new line/line break into a join calculation for a note or text type in survey123? I believe my question is similar to Counting "unique" selections across repeats. I'm hoping to create a summary list of all species at a site that were recorded in the repeat and what percent cover value was assigned to each species in a vertical list format, rather than one continuous string. Two questions inside the repeat are "species", and "cover"; my thought was to join the species and cover fields, and create a new line for the next pair responses. I played around with <br> and \n and multiline appearance but I wasn't able to figure anything out. 

Thanks

0 Kudos
7 Replies
JamesTedrick
Esri Esteemed Contributor

Hi Miles,

What are you trying to view the list in?  \n would be appropriate for text output.

0 Kudos
MilesMcCoy-Sulentic
Emerging Contributor

Hi James,

I was able to get \n working, and it appears to work for both note and text outputs. I think my attempts at concatenating questions from the repeat in the note were also causing an issue. Is it possible to concatenate multiple questions from a repeat inside of a join calculation (something like: join(',\n',concat(${species},${aacover})) - though this doesn't work)?

My goal was a summary table for the data in the repeat but I understand that's in the works? Way to summarize existing items inside a repeat? For plant surveys it's nice to have the whole list visible at once when reviewing it in the field to finalize things.

My work around was to create a group of notes to summarize each individual questions in the repeat  

JamesTedrick
Esri Esteemed Contributor

Hi Miles,

the join() is designed to concatenate the values from 1 question in a repeat - the concatenate wouldn't be appropriate. The GeoNet post you linked mentioned an enhancement of having a tabular view of repeats; as mentioned there, I logged that as a potential enhancement but it is not currently in Survey123's roadmap.  

In terms of creating a summary table, there is work being planned to provide this functionality within the feature report system (to provide this as output).  If it is needed in the form, it could possibly be done through a series of hidden questions that create 'bins' for each species that then get summed, with the results being concatenated together into a table; it also could be done via a beta feature (custom JS functions) that could process the repeat and generate the table a bit more efficiently.

ChrisRoberts2
Frequent Contributor

Hi Miles

 

I know this post is a little old now, but any chance you could attached how you did this?  I'm trying to achieve something very similar.

 

Thanks in Advance

 

Chris

0 Kudos
IJWeber
New Contributor

Hi Chris, 

I was able to get a stacked list like this using this in the calculate field: join("\n",${Species})

repeat this process for each field i.e. species, cover, phenology, and use the grid formatting to get them side by side and you'll serviceable plant species list!

A word of caution, if you have side by side stacked lists like Miles shows above, if you neglect to enter one field for one of the species (I.e., don't fill in phenology) the list can appear to be out of order because the. Not such a big deal if you're just using it for reference in the field but something to keep in mind. Good luck!

0 Kudos
ChaimSchwartz4
Frequent Contributor

Hello Miles McCoy-Sulentic‌ - any chance you can share with me how you broke the lines using \n? it doesn't seem to work for me. Thanks

KimberlyMcCallum
Regular Contributor

This doesn't work for me either. Any updates on this would be appreciated!

0 Kudos