Conditional statement syntax in Survey123 report template

301
1
Jump to solution
08-24-2022 04:37 PM
Katherine_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,
Katherine
0 Kudos
1 Solution

Accepted Solutions
Katherine_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,
Katherine

View solution in original post

1 Reply
Katherine_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,
Katherine