Select to view content in your preferred language

How to create list from multiselect selections?

63
3
yesterday
TL2
by
Frequent Contributor

In the last I have used Join() and html to create a list form a repeat using multi select on the final page of a survey as a summary.  In my new survey I must hide the repeat, this prevents the Join() function from reaching more than the first value.

Is there a way to use concat() html on a repeat result to create a list.  I realized it is already joined - like join() would do, but I need to insert the html.

Below is what I use to join() using my repeat:

concat('<li>',join("</li><li></li><li>",${repeatfield}),'</li>')

 

Tags (4)
0 Kudos
3 Replies
DougBrowning
MVP Esteemed Contributor

It may be do to wrapping it in the concat.  Some functions do not like that.   Try separating the join into its own field then use that field in the concat.

0 Kudos
TL2
by
Frequent Contributor

The function I mentioned works, but it works with a repeat.

I need to create a list using html from a value (multiselect) like Red,Yellow,Blue.

0 Kudos
DougBrowning
MVP Esteemed Contributor

Then you would need to use selected-at probably.  Pull out each value that way, then recombine using concat.  I do this and write out the max possibilities.  If it is blank just nothing shows.  But this may give you trailing commas.

This code also gets the label vs the name.  Seems like a lot of work just to add a comma though.

concat(jr:choice-name(selected-at(${Rash1},0), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},1), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},2), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},3), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},4), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},5), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},6), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},7), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},8), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},9), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},10), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},11), '${Rash1}'), ' - ', jr:choice-name(selected-at(${Rash1},12), '${Rash1}'), ' - ', ${Q1UserNotes})

0 Kudos