Change Text Color Based on Value from Nested If Statement?

2318
7
04-14-2020 04:44 PM
NEidenAZ
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

0 Kudos
7 Replies
FC_Basson
MVP Regular Contributor

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

<font color="red">Over Capacity</font>
0 Kudos
NEidenAZ
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?

0 Kudos
FC_Basson
MVP Regular Contributor

Try this:

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

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

0 Kudos
FC_Basson
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.

0 Kudos
CPoynter
Occasional Contributor III
0 Kudos
FC_Basson
MVP Regular Contributor

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

0 Kudos