Select to view content in your preferred language

Conditional statement syntax in Survey123 report template

2093
3
Jump to solution
08-24-2022 04:37 PM
Katie_Clark
MVP Alum

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

If this answer helped you, please consider giving a kudos and/or marking as the accepted solution. Thanks!
0 Kudos
1 Solution

Accepted Solutions
Katie_Clark
MVP Alum

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

If this answer helped you, please consider giving a kudos and/or marking as the accepted solution. Thanks!

View solution in original post

3 Replies
Katie_Clark
MVP Alum

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

If this answer helped you, please consider giving a kudos and/or marking as the accepted solution. Thanks!
TCKauhi
Occasional Contributor

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 Alum

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

Best,
Katie

If this answer helped you, please consider giving a kudos and/or marking as the accepted solution. Thanks!
0 Kudos