Survey123: Report Template if then statements

7311
10
10-30-2018 09:21 AM
by Anonymous User
Not applicable

Hello,

I am having some troubles with my Survey123 dynamic report template. I am trying to create a template that has a series of multiple choice questions. In the survey I have the questions setup so that if you check my "Evaluated" box in the question, you get a comment box. If you check the "enforced" box you get no comment box. My problem is in my report template i cannot figure out how to writ the code to only display the comment box in the printed report if the "evaluated" box is checked. If its not checked I would like no box to show up in report print out.  

I have attached a photo of my template, if anyone has any suggestions I wold appreciate it.

Thanks

Michael

0 Kudos
10 Replies
by Anonymous User
Not applicable

Hi Michael,

This is not currently supported. The relevant question conditions are hidden and displayed in the app and web app, however if those questions are included in your custom report template they will always be displayed.

Phil.

0 Kudos
erica_poisson
Frequent Contributor

Hi Phil,

I have a question on conditional statements as well...within my report, I have something set up like this -

${Standing_Location} (${if Corner_Landmarks==“other_sign”}${LD_Other_Sign_Details}${/})

When I test and export a report using my template,  only get the information that corresponds with my Standing_Location field. Everything within the if statement is excluded, even though the particular record I am testing with has Corner_Landmarks = other_sign, and even though the LD_Other_Sign_Details field is populated with information. I can't quite figure out why this is going wrong...

Thanks,
Erica

Erica
0 Kudos
erica_poisson
Frequent Contributor

Hi Phil,

Are there any plans to include the capability for if statements to control what displays in a report template? If yes, is there an anticipated date when this will be available?

I also think it could be advantageous to update some of the documentation surrounding this, as I didn't find it very clear there.

Thanks,
Erica

Erica
0 Kudos
erica_poisson
Frequent Contributor

Hi Phil,

Could you take a look at the conversation between Stephen and I on this thread Conditionals in Survey 123 Reports  and let me know why his statement works and mine doesn't? It seems to me our syntax is identical, so I'm just a little confused.

Also, the documentation on Ismael Chivite's https://community.esri.com/groups/survey123/blog/2018/07/06/bull-release-30 posting made me think this sort of thing was possible.

Thanks again,

Erica

Erica
0 Kudos
by Anonymous User
Not applicable

HI Erica,

Yes you are correct and link to the Bull Release blog post and some other information I found jogged my memory on conditional if statement, sorry about that. My previous comments to it not being supported were in regards to using the same relevant and if statements from within the xls form that are set in Connect and honouring those in the custom report template, currently that is not supported and if the placeholder is included in the report, then the answer will be printed regardless of whether the question was not relevant in the survey at the time.

However, you can use conditional if statements in your template and it is documented here: Feature report templates—Survey123 for ArcGIS | ArcGIS 

Note I believe this is not supported for select multiple questions due to the nature of the way the answer for select multiple is a comma delimited list, so if creating an if statement the value you are passing in has to match the value as it is stored in the feature layer. It can not pick out part of the stored value as a match.

Hope this helps.

Phil.

erica_poisson
Frequent Contributor

Hi Phil,

Thank you for the clarification on this! I appreciate it. It took me awhile to realize that I was attempting to use the results of a select_multiple within my conditional statement, and now I do see why that is a problem. Although I understand that select_multiple questions come into an attribute field as comma separated values, will it ever be possible to use them in if statements as I had been trying to do? I know my user who wanted this capability will ask me, so I'll give them the official answer.

Thanks for all the help.

Erica

Erica
0 Kudos
by Anonymous User
Not applicable

Hi Erica,

We have an open issue in our backlog to address this, however at this stage I am unsure on the timing to implement. In the meantime you will need to try and workaround it in other ways.

Phil.

JodyZhengLiu
Esri Contributor

Hi Erica,

The syntax of using conditional statements for select_multiple questions is available now on https://survey123beta.arcgis.com,along with other new beta features for the next release. We would love to have you have a test and share any feedback or issues you may encounter in the Survey123 Beta Website Feedback forum.

 

Thanks,

Jody Zheng Liu

0 Kudos
JodyZhengLiu
Esri Contributor

Hi Michael,

The syntax of using conditional statements for select_multiple questions is available now on https://survey123beta.arcgis.com,along with other new beta features for the next release. We would love to have you have a test and share any feedback or issues you may encounter in the Survey123 Beta Website Feedback forum.

 

Thanks,

Jody Zheng Liu

0 Kudos