Forum Discussion

KathyBenjamin's avatar
KathyBenjamin
Qrew Trainee
2 months ago

Color a mulit-line text based on another field (mulitple choice) response.

Hello,  I'm trying to find a way to color the text that is in a multi line text field based on another field (Multiple choice).  

If ([Mulitple Choice]="No",[Multi Line],color yellow)

Any suggestions would be greatly appreciated.  Thank you

 

  • This is actually a bit tricky to do because you were saying you have a multi line text field, and you want to colour it. The only way to colour the background is to make it a rich text formula field for display purposes, but then we have the problem that the carriage returns in a multi line select field are not recognized in a rich text formula field. So you would lose the carriage returns.  I did a test and this seems to work. But note that this would be a formula rich text field. 

     

    var text AddLineBreaks = URLDecode(SearchAndReplace(URLEncode([multi line]), "%0A", "<br>"));

    If(f ([Mulitple Choice]="No",
    "<div style=\"background-color: yellow;\"" & ">" & $AddLineBreaks & "</div>", $AddLineBreaks)