Hi,
i use grafana version 11.2.2
I have a dashboard, in the panel i have a query A to retrieve the username and i need to build a query B with this name to have more information on the user, but i can’t find a way to use the result of QueryA to put on the URL of Query B.
The panel its a repeat option, with multiple value of a global variable that use in query A.
Do you have a solution ?
query A :
Query B :
repeat option :
Thanks for your help
Step-by-Step Solution using GitHub API
Step 1: Fetch GitHub Usernames (Query A)
- Go to Grafana → Open your dashboard → Click on “Edit Panel”.
- Select Data Source: Infinity.
- Set Type: JSON / REST API.
- Set Method: GET.
- In URL, enter: https://api.github.com/orgs/grafana/members
- In Parsing Query, enter: $.login
(This extracts usernames from the API response.)
- Click Run Query → You should see usernames appear.
Step 2: Create a Variable $username
- Go to Dashboard Settings → Click on Variables.
- Click New → Name it username.
- Select Type: Query.
- Set Data Source: Infinity.
- In Query, enter: $.login
- Check Multi-value option.
- Click Save.
Now, $username stores all usernames dynamically.
Step 3: Fetch User Details (Query B)
- Add a new panel or edit an existing one.
- Select Data Source: Infinity.
- Set Type: JSON / REST API.
- Set Method: GET.
- In URL, enter: https://api.github.com/users/${username}
(This dynamically fetches details for each username.)
- In Parsing Query, extract the fields you need:
o $.login → Username
o $.name → Full Name
o $.public_repos → Repositories
o $.followers → Followers
o $.following → Following
- Click Run Query → You should see user details appear.
Step 4: Enable Panel Repeat
- Go to Panel Settings → Scroll to Repeat Options.
- Set Repeat by: $username.
- Click Save.
Now, the panel will repeat for each username, showing different user details dynamically!