Extract Field transform displays "null"

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


  • What are you trying to achieve?


I’m using the following data :

{"foo": "dude"}
{"bar": 125, "dude": null}

And using the Transform Data / Extract Field feature.

  • What happened?

Some cells not containing data are empty. Some display a “null” string.

Screenshot from 2023-11-29 16-46-51

  • What did you expect to happen?

I expect the cells not containing data to be empty. (or all of them to contain “null”).

What is the data source for this data

The data source doesn’t seem to be important. I tried first with a SQL query (PostgreSQL backend), but in the sandbox the data is Static.

Actually it is important as you could leverage functions in the querying language of the data source. here is an example in MS SQL



;with src
select '{"foo": "dude"}' as zaza union
select '{"bar": 125, "dude": null}'

from src
cross apply OPENJSON(src.zaza) WITH (
    foo NVARCHAR(50) '$.foo',
	bar INT '$.bar',
    dude  NVARCHAR(50)  '$.dude'