Select to view content in your preferred language

How can we remove extra blank lines in feature reports due to empty questions/fields?

1652
5
Jump to solution
05-18-2023 11:20 AM
Tiff
by
Frequent Contributor

My feature report for inspections references a feature layer and the most recent related record. It has over a dozen categories that have fields/questions ranging from optional open text boxes, multiple choice select, and photos.

I am able to use if statements around grouped questions so they do not show if not filled in, however, it results in a lot of empty lines in between sections (See attached image at the bottom). I have put if statements on the same lines where possible but still results in a few lines per question on the backend. 

Alternatively, can I instead format it so if it exists, include the value, if not, print "N/A"? That way the report would look a lot cleaner and provide clarity. However, with this I would also like to mitigate any blank lines. This in particular would be helpful to note for general categories that there is nothing filled for its subquestions. For example: Misconduct - N/A

I looked through forums/the quick reference but wasn't able to find the syntax. Thank you in advance!
FeatureReport_blanklines.png

0 Kudos
1 Solution

Accepted Solutions
Tiff
by
Frequent Contributor

Thanks to @Katie_Clark and some extra troubleshooting, there are some good solutions for reducing blank lines and also returning "N/A" where needed.

Syntax for select multiple questions:

${if field}${field}${/}${if !field}N/A${/}

Syntax for open text questions:

${if field=""}${field}${/}${if field==""}’N/A’${/}

If the goal is to skip fields rather than put N/A, using a table can help accomplish this. The repeat open and close tag should be placed within the table. Remove the table borders for it to fit more seamlessly within the report.

${#repeat}${if field1}Field1

${/}

${if field1}${field1}

${/}

${if field2}Field2

${/}

${if field2}${field2}

${/}${/}

 

I was also able to include photos, where applicable by using the invisible border trick. I do think this adds one extra line, but that is minimal and the feature report still looks great!

View solution in original post

5 Replies
Katie_Clark
MVP Regular Contributor

For conditional syntax in reports, you could try something that looks like this:

${if weeds}${weeds}${/}${if weeds==''}'N/A'${/}

If you could provide a copy of your report template that would also help in being able to help troubleshoot. 

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
Tiff
by
Frequent Contributor

Hello Katherine, thank you for your response! I tried your N/A line but got the following error: 

Error: An error occurred when checking the report template. Failed to parse ${# if'($true$) if weeds =='''} undefined

 

Attached is a snippet of my report template. Both are repeats. Those two examples apply to the rest of the ~15 questions. So then, for example, if no answers were provided for 1) weeds, and 2) diseases, pests and chemical use, then there would be lines of blank space until questions that contain answers. If you see my initial screenshot, there are two questions between "Weeds" and "Pathway & Deer Fence Encroachment" that are empty that result in those lines in between.

Any help is much appreciated, thank you!

Edit - note that the syntax for the two differ slightly with closing brackets since I was testing things out. I believe the rest of my report follows the second syntax but I am not sure which works best for addressing the blank lines.

0 Kudos
Katie_Clark
MVP Regular Contributor

Thanks for sending over the report template - would you also be able to share your XLS form? It would just really help streamline the process for me being able to help out and look at things. Thanks!

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
Tiff
by
Frequent Contributor

Hi Katherine, I just sent you a direct message. Thank you!

0 Kudos
Tiff
by
Frequent Contributor

Thanks to @Katie_Clark and some extra troubleshooting, there are some good solutions for reducing blank lines and also returning "N/A" where needed.

Syntax for select multiple questions:

${if field}${field}${/}${if !field}N/A${/}

Syntax for open text questions:

${if field=""}${field}${/}${if field==""}’N/A’${/}

If the goal is to skip fields rather than put N/A, using a table can help accomplish this. The repeat open and close tag should be placed within the table. Remove the table borders for it to fit more seamlessly within the report.

${#repeat}${if field1}Field1

${/}

${if field1}${field1}

${/}

${if field2}Field2

${/}

${if field2}${field2}

${/}${/}

 

I was also able to include photos, where applicable by using the invisible border trick. I do think this adds one extra line, but that is minimal and the feature report still looks great!