Help on how to obtain this result

Hello, I would like some help, I would like to know if it is possible to do it?

I have the firewall equipment ports registered in my Zabbix.

And in it I have some information about the port, such as status, name, speed, consumption, etc!

So, I have the following port parameters:
Interface eth0: Name
Interface eth0: Operational Status
eth0 Interface: Speed
eth0 Interface: Bits Received
eth0 Interface: Bits Sent

I would like to combine two pieces of information in the same Stat view and map the values.

The data I want is:
eth0 Interface: Status
Interface eth0: Name

So let’s go, I want to get the Port Status, where the values go from 0 to 2, being:

2 - Starting
1 - Online
0 - Offline

Atualemnet I manually map these values where I define the following:

Value = 2 / Display text: PORT NAME / Color: rgb(224, 180, 0)
Value = 1 / Display text: PORT NAME / Color: rgb(55, 135, 45)
Value = 0 / Display text: PORT NAME / Color: rgb(196, 22, 42)

However, if someone changes the name of the port in the firewall, it will not update in Grafana, because I did the mapping manually, I would like to automate it, since Zabbix provides this information with the name of the port.

And I wouldn’t want to do this with two different views, I wanted to do this in the same view, where the status field would only serve to map the background color of the view according to the status and the displayed name would be the name that came from the name field!

I made several attempts here and didn’t succeed, does anyone have any idea how to do it?

A test I did and it came close to what I wanted, I did the following, I created a table for the mapping containing the fields:

Status
Color
Observation

And in grafana, I added the port fields and added this table:

Staying:

Query: A
eth0 Interface: Status

Query: B
Interface eth0: Name

Query: C
SELECT Status, Color, Obs FROM Grafana.wg_port_status

Then I transformed the Query C data using: “Config from query results”:

Status = Value mappings / Value
Color = Value mappings / Color

So far the color mapping worked, but I can’t include Query B as Display Text

As a test, I include the observation field as Display Text and as this field is in the same table, I can use it, it works, it displays what is in the Status field as Mapping Text.

From what I could understand, I would have to join Query B, together with Query C, forming a table that would be a Query D and transform the data into Query D.

But I couldn’t make this connection.

I don’t know if I was clear with what I need to do!