Select to view content in your preferred language

Survey123

267
6
Jump to solution
06-14-2024 10:21 AM
Labels (1)
GISIntern21
New Contributor

I am trying to create how to have a line break in word templates for Survey123. I have tried \n and <br>. Any suggestions?

${comments}${field_83} ${field_85} ${field_87} ${field_90} ${field_92} ${field_94} ${field_96} ${field_98} ${field_100} ${field_102} ${field_104} ${field_106} ${field_108} ${field_110} ${field_112} ${field_114} ${field_116} ${field_118} ${field_120} ${field_122} ${field_124} ${field_126} ${field_128} ${field_130} ${comments_recommendations}

0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Regular Contributor

Use IF. IF on its own acts like an "if not null, do the thing". In practice, there are two uses of IF in this context:

  1. On it's own, the field will only appear if it contains a value. E.g., ${if field_83}
  2. As a full logic statement. E.g., ${if field_83}${field_83}${/}

I much prefer option #2 as you can add conditional formatting. Try this. It will conditionally show each "field_xx" on a new line if it contains data.

${comments}${if field_83}

${field_83}${/}${if field_85}

${field_85}${/}${if field_87}

${field_87}${/}

${comments_recommendations}

View solution in original post

0 Kudos
6 Replies
DougBrowning
MVP Esteemed Contributor

Did you try just enter in the word doc?  That worked for me I think.

0 Kudos
abureaux
MVP Regular Contributor

100% this. Feature Reports use normal MS Word formatting. HTML will not work.

E.g., If you want to color and bold your output, you'd just do that formatting to the tag itself: ${field_83} would result in My text output.

GISIntern21
New Contributor

Yes I tried that but some of the values are null and I don't want to have a blank space where there is a null value. Is there any idea to just showcase the values which don't have null values.

0 Kudos
GISIntern21
New Contributor

Screenshot 2024-06-17 135234.png

 

My output look like this but I want it to be organized in different lines without the null values inbetween

0 Kudos
abureaux
MVP Regular Contributor

Use IF. IF on its own acts like an "if not null, do the thing". In practice, there are two uses of IF in this context:

  1. On it's own, the field will only appear if it contains a value. E.g., ${if field_83}
  2. As a full logic statement. E.g., ${if field_83}${field_83}${/}

I much prefer option #2 as you can add conditional formatting. Try this. It will conditionally show each "field_xx" on a new line if it contains data.

${comments}${if field_83}

${field_83}${/}${if field_85}

${field_85}${/}${if field_87}

${field_87}${/}

${comments_recommendations}

0 Kudos
GISIntern21
New Contributor

Thank you so much it worked 🙂

0 Kudos