Select to view content in your preferred language

Survey123 Web Design-Visibility Rules and Report Templates

607
3
03-03-2024 10:51 AM
Hollreiser_Kelly
New Contributor

Hello, I am creating a survey that includes questions that are based on visibility rule settings and I am having trouble with the Report templates.

This is how I have it setup in the Web Designer: When the visibility rule is not met: Do not submit the answers in this group

When I generate a report (using the Individual Record standard report template Esri provides), it does not appear that the visibility rule is applying to the report. Basically, I do not wish for the reports generated to show questions that were not answered because they are conditional based on the visibility rules. 
 
Here is how the form is setup in web designer:
Hollreiser_Kelly_1-1709491668622.png Hollreiser_Kelly_2-1709491698761.png
Here is how the form looks when a user is inputting data:
 
Hollreiser_Kelly_0-1709491516886.png

 

and here is what the Generated Report  looks like:

Hollreiser_Kelly_3-1709491798296.png

Is there a way to make the generated report hide questions that were not answered?

Any help would be greatly appreciated! 

Thanks

 

0 Kudos
3 Replies
RoryMcPherson
New Contributor III

You can use a simple condition expression in your report template to only show questions if an answer has been provided. The most basic syntax to show something in a report if there is an answer provided to a survey question is:

${if <fieldname>} ... ${/}

Please note to substitute in your own fieldname, and don't include the < or > either. Within this (where I have typed ...) you can put in the value for this question (e.g., ${question1}, along with anything else, such as the question text itself. This then sets up your report so that the question does not appear in your report unless that question has been answered. This is the most basic example, as you can do many other things like only show the content if they answered option a, or a value over a certain number value, etc. 

You can read more about this under the Conditional report elements heading in the official documentation.

0 Kudos
Hollreiser_Kelly
New Contributor

Hello, 

Thanks for your help with this. I am still having issues getting the expression to work so I wanted to provide more details to see if I can get anymore feedback. The example I am providing here is different than what I offered in my initial post.

The form I created is an artifact log that field folks can use to record and collect pertinent data on diagnostic artifacts in the field. The survey123 form is setup with a single select question with approximately 18 options. Each option triggers a different drop-down list of visibility dependent questions based on what option one selects when filling out the form. Each option has questions pertinent to a specific artifact. Additionally, the single select along with all of the 18 options and their visibility dependent questions are repeatable, so a person can record various artifacts as they find them in the field and multiple types of the same type of artifact, etc.

The survey123 form is working as expected in the app and when used on the web but I don't like how the esri provided report template looks when reports are generated. Currently, it is showing all of the labels/questions and empty spaces for unanswered questions for all of the various options when only one option has had data collected for it. What I would like is for the form to be generated in a way that only shows data that was collected. Currently, there are lots of labels/questions with empty spaces of the unanswered questions beneath them.

When looking at the form you are scrolling through tons of pages to finally get to the next set of data for an artifact.  

I've tried entering 

${if field_259} ${/}

for all name field names in the report. However, all empty spaces and labels/questions are still visible in the form. 

Here is an example of something I would like to hide in my form, only when there isn't any data collected for the label/question. 

Biface  <--hide

Material Type <--hide

${field_259}  <--hide (currently when reports are generated it is a blank space with no data in it but it is still a blank space or box)

 

Other <--hide

${field_259_other} <--hide (currently when reports are generated it is a blank space with no data in it but it is still a blank space or box)

 

Material Type Detailed Descriptor <--hide

${material_type_detailed_descript} <--hide (currently when reports are generated it is a blank space with no data in it but it is still a blank space or box)

 

Any help would be greatly appreciated!

0 Kudos
Hollreiser_Kelly
New Contributor

Hello all!! I finally got the syntax right on this. For anyone that is struggling with something similar here is a sample of what worked to hide unanswered portions of the survey. 

 

Artifact Type

${field_155}

 

${if field_155==”Biface”}

Biface

Material Type

${field_259}

 

Other

${field_259_other}

 

Material Type Detailed Descriptor

${material_type_detailed_descript}

 

Biface Condition

${biface_condition}

 

Biface Reduction Stage

${biface_reduction_stage}

 

Biface Edge Damage

${biface_edge_damage}

 

Unit of Measurement

${unit_of_measurement}

 

Length

${_length}

 

Width

${width}

 

Thickness

${field_166}

 

Arris

${arris}

 

Comments

${field_168}

${/}

0 Kudos