Conditional statement syntax in Survey123 report template

956
3
Jump to solution
08-24-2022 04:37 PM
Katie_Clark
MVP Regular Contributor

Hello,

I know it's possible to use conditional logic in feature report templates, and I've used it before when I'm only checking against one field. However, I need to set up a statement that use '&&' to check against two different fields.

I have something like this, but haven't gotten it to work so far:

${if dom_test == “Yes”} && ${rapid_test == "No"}X${/}${if dom_test == “No”}${/}

I want the cell in the table to be filled with an 'X' ONLY IF the answer to dom_test is "Yes" AND the answer to rapid_test is "No". Otherwise, leave the cell blank.

I've read the documentation here but didn't see any specific examples of how to format this. Thanks for any assistance!

@IsmaelChivite @JamesTedrick 

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
1 Solution

Accepted Solutions
Katie_Clark
MVP Regular Contributor

After many many iterations of trial and error, I got it to work.

${if rapid_test == “No” && dom_test == “Yes”}X${/}

I was thrown off because you need to reference the second field without using the dollar sign and curly bracket syntax. Perhaps this post will help someone in the future. 

 

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

View solution in original post

3 Replies
Katie_Clark
MVP Regular Contributor

After many many iterations of trial and error, I got it to work.

${if rapid_test == “No” && dom_test == “Yes”}X${/}

I was thrown off because you need to reference the second field without using the dollar sign and curly bracket syntax. Perhaps this post will help someone in the future. 

 

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
TCKauhi
New Contributor II

Thank you @Katie_Clark , this helped me finally figure out how to create conditional formatting for values with ranges in my feature report. 

Katie_Clark
MVP Regular Contributor

Oh yay! I'm so glad my post could help. 🙂

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