Change Text Color Based on Value from Nested If Statement?

241
7
04-14-2020 04:44 PM
Highlighted
New Contributor II

Hello! I'm wondering if it's possible to change the color of text based on the value from a nested If statement? I'm building a survey and based on a nested If statement, 3 answers are possible, which will in turn populate a Status field. If the facility is over capacity, I'd like the text to be Red, if at Capacity, Yellow, and if Below Capacity, Green.

Thanks!

~Nikki Eiden, AZ Dept. of Health Services 

James Tedrick

Reply
0 Kudos
7 Replies
Highlighted
MVP Regular Contributor

Try changing the output text from the IF-statement to HTML formatted text e.g.

<font color="red">Over Capacity</font>
Reply
0 Kudos
Highlighted
New Contributor II

Thanks for the idea. I gave it a try, no luck. S123 didn't like it when I saved the excel. Have you successfully used this technique? Perhaps I got the syntax wrong?

Reply
0 Kudos
Highlighted
MVP Regular Contributor

Try this:

if(${CurrentCapacity}>${Capacity_Total}, '<font color="red">OverCapacity</font>', 'Other')
Reply
0 Kudos
Highlighted
New Contributor II

Thanks again! no luck 😞 Would you happen to have a screen shot of this in a  XLSForm? 

Reply
0 Kudos
Highlighted
MVP Regular Contributor

I tried the syntax provided in a form and it worked. 

And this is the output form.

      

I assume your nested IF statement is working as it should.  See what happens if you add a "name" to your Status note.

Reply
0 Kudos
Highlighted
Occasional Contributor III
Reply
0 Kudos
Highlighted
MVP Regular Contributor

Based on the answer provided by Craig, what version of Survey123 Connect are you using?

Reply
0 Kudos