Value Mapping doesn’t work

  • What Grafana version and what operating system are you using?

Grafana v10.1.5, hosted locally on linux machine.

  • What are you trying to achieve?

Light up cells in a table visualization panel with red coloured text when their value is equal to “FAIL”.

  • How are you trying to achieve it?

I added the following rule in value mappings:

I tried to do the same for specific column using Override, but it didn’t work either.

  • What happened?

Nothing.

  • What did you expect to happen?

Text changes colour.

  • Can you copy/paste the configuration(s) that you are having problems with?

SQL query:

            SELECT
                execution_time,
                build,
                result,
-- some more fields
            FROM
                metadata
            WHERE
-- some filters            
            ORDER BY
                execution_time DESC;

Mappings defined as:

          "mappings": [
            {
              "options": {
                "FAIL": {
                  "color": "dark-red",
                  "index": 0,
                  "text": "failing"
                },
                "PASS": {
                  "color": "dark-green",
                  "index": 1,
                  "text": "passed!"
                }
              },
              "type": "value"
            }
          ],
  • Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.

No errors.

Are you sure you do not have maybe other overrides etc?

Shame to admit but I had an override for one of the columns that I overlooked.
What I also forgot to add was Cell type override, see:

image

I guess one sometimes needs fresh eyes and right question asked by another person:)
Thanks for you help!

1 Like