Need help changing text element color

Hi,
I have a simple repeating group that shows county names and then a rating.

I want to change the font color of the county name when the rating is in a specific range. Example: if rating is > 5.5 font color changes to green.

The rating is being calculated as below:

I assumed I could use a conditional on the county name that was, When Avg Rating is > 5.5 change font color to Green but I don’t have those choices.

I haven’t had any luck with custom states so any help is appreciated!

Thanks!

Here’s an odd solution:

Why don’t you try putting the scores inside an input element (disabled)?

So, instead of using a Text element to render the scores your render them inside an Input, which you disable of course.
Then you set the initial value to the rating calculation and remove the borders so it looks just like a regular text element.

This way you’ll be able to access the input’s value (rate) and apply the desired logic.

I gave it a try but the font color doesn’t change. Here is the RG

And the conditional to change the font color

Thoughts?

Make sure you are placing the text in the ‘Inital value’ field of the input rather than the placeholder. !

If I’m understanding right, it doesn’t like what I’m doing.

When I do the calculation in the placeholder, the input returns the correct value but the conditional on the county text doesn’t work.

What’s the error message display on the editor?

You probably have to change the content format.
Bare in mind the content of the input will be empty if you place the rate on the placeholder…

You could put the input inside a Group with a content type ‘number’ and place the rate calc as the data source. Then pull the value from the parent group as the inital content.

some progress but not quite there. You’ve given me some things to work from so Thank You. I have to step away for the night but will work on it over the weekend.

So, I had to try one more thing before shutting down and it worked!

Thank you for your help!

Happy to help!