Change text colour of embedded data variable | XM Community
Skip to main content
I have embedded data variables that assign a category based on a score (eg. if score is under 5, category is 'high'). I want to present the category back to the respondent, and colour the text based on the category (ie. red for high). Because of the vast number of combinations (each respondent has 12 scores with 3+ categories) display logic seems tricky.



Does anyone have a way to approach this using javascript, css, html? I am new to all of them and would appreciate a push in the right direction.
When you assign the category ED also assign a categoryColor ED. Then your html is:

```

<span style="color:${e://Field/categoryColor}">${e://Field/category}</span>

```
Thanks @TomG - very simple and working perfectly.

Leave a Reply