Unable to Use $map in Infinity Plugin

Hi there!

I’m currently using Infinity Plugin Version 2.11.4 with Grafana and trying to process data using the $map function, but it’s not working as expected.

When I write something like this:

$map($.data, function($v, $index) {
    return {
        "date": $v.date,
        "value": $v.value
    };
});

I don’t get any output. My data structure looks like this:

{
  "data": [
    { "date": "2024-12-01", "value": 20000 },
    { "date": "2024-12-02", "value": 30200 },
    { "date": "2024-12-03", "value": 42000 }
  ]
}

Questions:

  1. Is $map supported in version 2.11.4 of the Infinity plugin?
  2. How should I structure the $map logic properly for this version?
  3. Are there any compatibility or syntax changes required for version 2.11.4?

Any help would be greatly appreciated!

Hi,
Try removing semicolons:

$map($.data, function($v, $index) {
    {
        "date": $v.date,
        "value": $v.value
    }
})

worked for me (although I have infinity 2.0.0).

Hi
I did this as well, and it still shows ‘no data.’ I also changed the Infinity version to 2.0.0, but it still didn’t make any difference.

Make sure you are using backend parser

vs