Skip to content

Using Grafana variables in JSONata field if panel repeat is activated #227

@LukasK13

Description

@LukasK13

I'm having a panel that is repeated for a Grafana variable (let's call it variable1).
In my JSON query, I want to check, if the result array contains an object with the attribute user that is equal to the iterated value of variable1:

$count($.items[user = $variable1[0]])

However, the values of variable1 are not being iterated even though the panel repeat options are set to variable1. The line $variable1[0] always returns the first entry of the array variable1 and not the iterated value.
How can I get this to work or is this behavior by design?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions