Conditionals in Survey 123 Reports

6504
12
11-07-2018 01:21 PM
DavidJones19
New Contributor

I found very little in the documentation. What I am trying to do is generate a report and show the questions and answers only if a certain single choice answer is given. I downloaded the template

1. Question text was here?

${field_5}

First I tried 

${if field_5=choice1}

1. Question text was here?

${field_5}

${/}

This generated a syntax error. Next I tried 

${if field_5|selected:"choice1"}

1. Question text was here?

${field_5}

${/}

and the report seems like it is generating but never gets above 0%. 

0 Kudos
12 Replies
OrçunAkkay
New Contributor III

My excel file is so complicated it has 684 lines but i am sure you can understand the problem from these screenshots. In the first one, "Bina Yapı Belgesi Durumu" is hidden, so other fields are placed on next lines.

0 Kudos
JodyZhengLiu
Esri Contributor

Hi Orcun,

This is a known limitation for now. I encourage you to submit an enhancement request via Esri Support. Our Support team will assign an official enhancement number for your records. Similar requests from other customers can then be attached to the same enhancement request, which helps us assess demand for the enhancement and prioritize it accordingly.

Thanks,

Jody Zheng Liu

0 Kudos
ChrisCzerwinski
New Contributor III

I was running into a similar issue, and finally figured it out on a "select_one" scenario.
My if statement originally referenced the <Name> value for the choices for a particular question, instead of the <Label>.

${re_inspection_required_by | selected:"site_visit_2"}  SITE VISIT #2 (${if re_inspection_required_by=="site_visit_2"}${date_for_re_inspection | format:"MM/DD/YYYY"}${/})    DOESNT WORK

${re_inspection_required_by | selected:"site_visit_2"}  SITE VISIT #2 (${if re_inspection_required_by=="SITE VISIT #2"}${date_for_re_inspection | format:"MM/DD/YYYY"}${/})   WORKS!!!

Result: 

☑   SITE VISIT #2 (04/26/2019)