Disable column being hide

Hi, I am using infinity data source and using jsonata to parse my json. and the result of parsing will become a json with key value pair, and the key will be the column header. I have some column having all the values null, and Grafana is hide/ just does not show the column, how can I have all my column show?

Blockquote

please share your json data

{
  "date": "2024-03-14",
   "reading": null
}

this is my data :

{
    "statement_id": "01eee28d-45e8-17ea-83aa-75ac2c73e6e2",
    "status": {
        "state": "SUCCEEDED"
    },
    "manifest": {
        "format": "JSON_ARRAY",
        "schema": {
            "column_count": 5,
            "columns": [
                {
                    "name": "role_id",
                    "type_text": "INT",
                    "type_name": "INT",
                    "position": 0
                },
                {
                    "name": "namespace_id",
                    "type_text": "INT",
                    "type_name": "INT",
                    "position": 1
                },
                {
                    "name": "name",
                    "type_text": "STRING",
                    "type_name": "STRING",
                    "position": 2
                },
                {
                    "name": "parent_id",
                    "type_text": "INT",
                    "type_name": "INT",
                    "position": 3
                },
                {
                    "name": "sys_type",
                    "type_text": "STRING",
                    "type_name": "STRING",
                    "position": 4
                }
            ]
        },
        "total_chunk_count": 1,
        "chunks": [
            {
                "chunk_index": 0,
                "row_offset": 0,
                "row_count": 5
            }
        ],
        "total_row_count": 5,
        "truncated": false
    },
    "result": {
        "chunk_index": 0,
        "row_offset": 0,
        "row_count": 5,
        "data_array": [
            [
                "1",
                "1",
                "XVD",
                null,
                "A"
            ],
            [
                "2",
                "1",
                "RTG",
                null,
                "U"
            ],
            [
                "3",
                "1",
                "YYZ",
                null,
                "U"
            ],
            [
                "4",
                "1",
                "XXZ",
                null,
                "U"
            ],
            [
                "5",
                "1",
                "XXX",
                null,
                "U"
            ]
        ]
    }
}

this is my query:
$map($.result.data_array, function($row){ $merge($map($$.manifest.schema.columns,function($key, $key_index){
return {
$key.name : $row[$key_index]
}
}))
})

1 Like

Which visualization are you using for this? There is no value to plot in the final data

  {
    "role_id": "1",
    "namespace_id": "1",
    "name": "XVD",
    "parent_id": null,
    "sys_type": "A"
  },

hence

i am using table panel

Please share screen capture of your issue.


This is my panel. For your context the panel json looks like this

{
“datasource”: {
“uid”: “XXX”,
“type”: “yesoreyeram-infinity-datasource”
},
“fieldConfig”: {
“defaults”: {
“custom”: {
“align”: “auto”,
“cellOptions”: {
“type”: “auto”
},
“inspect”: false,
“filterable”: false
},
“unitScale”: false,
“mappings”: ,
“thresholds”: {
“mode”: “absolute”,
“steps”: [
{
“color”: “green”,
“value”: null
},
{
“color”: “red”,
“value”: 80
}
]
},
“color”: {
“mode”: “thresholds”
},
“links”:
},
“overrides”:
},
“gridPos”: {
“h”: 7,
“w”: 24,
“x”: 0,
“y”: 7
},
“id”: 4,
“options”: {
“showHeader”: true,
“cellHeight”: “sm”,
“footer”: {
“show”: false,
“reducer”: [
“sum”
],
“countRows”: false,
“fields”: “”
},
“frameIndex”: 0
},
“pluginVersion”: “10.3.3”,
“targets”: [
{
“datasource”: {
“type”: “yesoreyeram-infinity-datasource”,
“uid”: “XXX”
},
“columns”: ,
“filters”: ,
“format”: “as-is”,
“global_query_id”: “”,
“hide”: false,
“json_options”: {
“columnar”: false,
“root_is_not_array”: true
},
“parser”: “backend”,
“refId”: “Query”,
“root_selector”: “$map($.result.data_array, function($row){ $merge($map($$.manifest.schema.columns,function($key, $key_index){\nreturn {\n$key.name : $row[$key_index]\n}\n}))\n})”,
“source”: “inline”,
“type”: “json”,
“url”: “XXX”,
“url_options”: {
“body_content_type”: “application/json”,
“body_type”: “raw”,
“data”: “{\r\n "statement": "select * from [[DatabaseName]].[[TableName]] limit 5", \r\n "warehouse_id": "xcxxc"\r\n}”,
“method”: “POST”
},
“data”: “{\n "statement_id": "01eee28d-45e8-17ea-83aa-75ac2c73e6e2",\n "status": {\n "state": "SUCCEEDED"\n },\n "manifest": {\n "format": "JSON_ARRAY",\n "schema": {\n "column_count": 5,\n "columns": [\n {\n "name": "role_id",\n "type_text": "INT",\n "type_name": "INT",\n "position": 0\n },\n {\n "name": "namespace_id",\n "type_text": "INT",\n "type_name": "INT",\n "position": 1\n },\n {\n "name": "name",\n "type_text": "STRING",\n "type_name": "STRING",\n "position": 2\n },\n {\n "name": "parent_id",\n "type_text": "INT",\n "type_name": "INT",\n "position": 3\n },\n {\n "name": "sys_type",\n "type_text": "STRING",\n "type_name": "STRING",\n "position": 4\n }\n ]\n },\n "total_chunk_count": 1,\n "chunks": [\n {\n "chunk_index": 0,\n "row_offset": 0,\n "row_count": 5\n }\n ],\n "total_row_count": 5,\n "truncated": false\n },\n "result": {\n "chunk_index": 0,\n "row_offset": 0,\n "row_count": 5,\n "data_array": [\n [\n "1",\n "1",\n "XVD",\n null,\n "A"\n ],\n [\n "2",\n "1",\n "RTG",\n null,\n "U"\n ],\n [\n "3",\n "1",\n "YYZ",\n null,\n "U"\n ],\n [\n "4",\n "1",\n "XXZ",\n null,\n "U"\n ],\n [\n "5",\n "1",\n "XXX",\n null,\n "U"\n ]\n ]\n }\n}”
}
],
“title”: “Result”,
“transformations”: ,
“type”: “table”
}

So in your case the issue is it is hiding parent_id column?

I believe this post answers the question of how to disable the null value being hidden.

Yes you’re right!