Survey123 report template: If condition(s) to select multiple choices of select_one field

1805
2
Jump to solution
02-18-2021 11:23 PM
mkuttnernpns
New Contributor II

Hello together,

my name is Michael and I´m working for the Neusiedler See National Park as their GIS administrator. Currently we began to setup and integrate esri field apps for our field surveys and routines - therefore applying AG collector in conjunction with AG Survey 123.. For one use case where my colleagues have been mapping infrastructure elements throughout the park I´m facing a seemingly minor but for me (in the moment) unsolvable problem. I´ve set up questions in this  Survey123 like this --> a select_one question targeting at different types of signs for visitors. So, within the survey for a distinct element there one must choose if it´s a sign of type "A", "B" or "C". When having chosen "A" or "B" a follow-up definition field would pop up, while having chosen "C" would lead to the next block of questions.

When it comes to reporting I want to avoid to display a blank field (header) on the page in case answer "C" has been chosen, and vice versa the field should only be visible when "A" or "B" have been chosen. Using an if condition helps to either display it or not for each single statement.. So, what works is:

${if type_of_shild | selected: "A"} Schildinfo: ${summary_field} ${/}

${if type_of_shild | selected: "B"} Schildinfo: ${summary_field} ${/}

But in case "B" is chosen there is quite some empty space (3 lines) left in the report because only the second "Schildinfo : ...." is filled. I´ve been desparately trying to solve this issue by expressing an IF/OR-IF statement - meaning if "A" or "B" have been selected for "type_of_shild" THEN "summary_field" should be displayed. Any clues anyone? Thanks a lot in advance, Michael

0 Kudos
1 Solution

Accepted Solutions
BarbaraWebster1
Esri Regular Contributor

Hi Michael,
One method for preventing unwanted returns from being shown in the exported report is to place them within the conditional statement in the template report. For example, if you move the end tag for the ${if type_of_shild | selected: "A"} conditional statement to just before the beginning of the next conditional statement, the return will only be included in the exported report if “A” is selected.


${if type_of_shild | selected: "A"} Schildinfo: ${summary_field}
${/}${if type_of_shild | selected: "B"} Schildinfo: ${summary_field} ${/}

 


Thanks,
-Barbara

View solution in original post

0 Kudos
2 Replies
BarbaraWebster1
Esri Regular Contributor

Hi Michael,
One method for preventing unwanted returns from being shown in the exported report is to place them within the conditional statement in the template report. For example, if you move the end tag for the ${if type_of_shild | selected: "A"} conditional statement to just before the beginning of the next conditional statement, the return will only be included in the exported report if “A” is selected.


${if type_of_shild | selected: "A"} Schildinfo: ${summary_field}
${/}${if type_of_shild | selected: "B"} Schildinfo: ${summary_field} ${/}

 


Thanks,
-Barbara

0 Kudos
mkuttnernpns
New Contributor II

Hi Barbara,

thank you very much for your reply - as I´m currently working on several Surveys/Survey-Reports I´ll definitely give it a try!

Kind regards, Michael

0 Kudos