Documentation around - Conditional elements in report templates

1422
3
Jump to solution
06-14-2018 04:43 PM
by Anonymous User
Not applicable

Hi all,

The latest Survey123 update mentions that Report templates now support conditional elements to show or hide content depending on answers in th....

But, I haven't been able to find any documentation around this?

Could anyone point me in the right direction.

Thanks,

Gee

0 Kudos
1 Solution

Accepted Solutions
ClaireProctor
Occasional Contributor

Hi Geethaka,

I write the documentation for Survey123, so I'm the one that has to apologize here. Unfortunately, for multiple reasons, the documentation for conditional statements didn't make it in time for the 2.8 release. The full documentation will be in the next release, but here's a grab that should hopefully get you started:

Elements of a report can be shown or hidden conditionally through the use of if statements. The if statement can be used through entering an expression into the starting placeholder ${if expression}, with ${/} denoting the end of the conditional segment. Some examples of if statements that could be used to hide parts of a report are:

  • ${if photo1} would display the section only if the photo1 question has been answered.
  • ${if integer1>0} would display the section only if the answer to the integer1 question was a positive number.
  • ${if ((geopoint | getValue:"x")>0)} would display the section only if the geopoint is in the Northern Hemisphere.

View solution in original post

3 Replies
ClaireProctor
Occasional Contributor

Hi Geethaka,

I write the documentation for Survey123, so I'm the one that has to apologize here. Unfortunately, for multiple reasons, the documentation for conditional statements didn't make it in time for the 2.8 release. The full documentation will be in the next release, but here's a grab that should hopefully get you started:

Elements of a report can be shown or hidden conditionally through the use of if statements. The if statement can be used through entering an expression into the starting placeholder ${if expression}, with ${/} denoting the end of the conditional segment. Some examples of if statements that could be used to hide parts of a report are:

  • ${if photo1} would display the section only if the photo1 question has been answered.
  • ${if integer1>0} would display the section only if the answer to the integer1 question was a positive number.
  • ${if ((geopoint | getValue:"x")>0)} would display the section only if the geopoint is in the Northern Hemisphere.
by Anonymous User
Not applicable

This is GREAT

Thanks Claire Proctor

0 Kudos
DavidBooth
New Contributor II

Hi Claire,

Any new documentation yet on this subject?

Specifically, I'm looking for the correct syntax for the opposite of:

  • ${if photo1} would display the section only if the photo1 question has been answered.

.... so what's the expression to display the section only if the photo 1 question has NOT been answered?

Thanks,

David Booth