I have a repeat. Inside the repeat is a select_one field from a list like below:
list_name | name | label |
proplist | 1 | prop1 |
proplist | 2 | prop2 |
proplist | 3 | prop3 |
proplist | 4 | prop4 |
proplist | 5 | prop5 |
I want to present the user with a list of what they have chosen in the repeat - the join( ) command is useful here, and works, but returns the name from the entry and not the label.
Example:
I enter 2 records in my repeat, where I chose from the list prop1,prop3. The output of join shows "1,3". Which is correct.
join() on its own: join(',',${property}) (shows 1,3)
What I want is the join() to show "prop1,prop3".
I've tried using jr:choice-name inside my join() function but that doesn't seem to work.
join() with my non-working use of jr:choice-name: join(',',jr:choice-name(${property},'${property}'))
Perhaps someone can point me in the right direction.
Sample survey attached.
Thanks for any help,
Tom S.
Solved! Go to Solution.
Hi Tom Schwartzman,
Thanks for the feedback and the test XLSForm file.
After looking into the issue, I can confirm it's a bug that if you want to join the labels of a select_one question in a repeat by using join() + jr:choice-name() functions, the result will be duplicated N times where N is the current repeat count.
I've logged one issue in our dev repo. It will be good if you can also raise an issue to Esri Support to prioritize the issue.
Thanks,
Zhifang
Hi Tom,
Have you tried moving the jr choice name outside of the join expression? Put each one in is own hidden/null field so that the label is displayed only in that field for each response, and then do the join based on those hidden/null fields, that should work as you are expecting.
Regards,
Phil.
Thanks Phil. That does work, but not in my use case but only in the web survey. In my repeat I added a hidden null field of the jr:choice-name, and then outside the repeat I join those up.
However in my survey, where you specify the # of repeats before getting into the repeats themselves, this does not work right.
In the survey app, I see prop1,prop2,etc and it grows as I add properties to the repeat. That is good, and what I expect.
In the web app, say I choose 3 repeats in advance, I see prop1,prop1,prop1,prop2,prop2,prop2....
I will upload screenshots and xlsx
Hi Tom Schwartzman,
Thanks for the feedback and the test XLSForm file.
After looking into the issue, I can confirm it's a bug that if you want to join the labels of a select_one question in a repeat by using join() + jr:choice-name() functions, the result will be duplicated N times where N is the current repeat count.
I've logged one issue in our dev repo. It will be good if you can also raise an issue to Esri Support to prioritize the issue.
Thanks,
Zhifang
Thanks Zhifang. Will submit to support as well.
Hi @TomSchwartzman ,
FYI, the issue has been fixed in the web app in our October release , you can have a try and please let us know if you still observe any issue.