How can I use data from query A to do the query B?

Hi All

  • What Grafana version and what operating system are you using?
    Grafana v8.3.3 (30bb7a93c)

  • What are you trying to achieve?
    I try to build a query accessing to JSON/rest api.
    To get the data I need, I have to do 2 requests. The first one to get an id and the 2nd using this id to get the data I need to graph.
    I tried to use the infinity plugin but I do not know how to get the data of the request A to put the id in the url defined in the request 2.

  • How are you trying to achieve it?
    I am using the plugin json infinity in Explore.
    I defined the 1st query A where I can get the Id. Actually it is possible to get 1 id or more…
    The request look like this /api/results

I defined the query B. I need the id of the query A to complete the api request.
The request look like this /api/results/id
But I did not find the solution.
I tried $A[0].Id (first line of the Id from the query A) but it did not worked

  • What happened?
    No line appear on the results

  • What did you expect to happen?
    I expect to be able to do the query B with the ID from the query A

Can somebody help on my issue?

Thanks in advance,

Probably you need to adjust your first query as template variable and then use the second query referred to that variable

Hi
Thanks for your response.
I tried but I could not setup a variable using the plugin json. I have some errors when I want to setup filters. That’s why I try to find a work around.