Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for __text and __value in variables #120

Closed
gelicia opened this issue Nov 21, 2023 · 3 comments
Closed

Support for __text and __value in variables #120

gelicia opened this issue Nov 21, 2023 · 3 comments
Labels
pending-closure This issue is stale and will be cleaned up

Comments

@gelicia
Copy link

gelicia commented Nov 21, 2023

Describe the bug
In Grafana, users can set up query variables to build variable lists for filtering their dashboards. To support a key/value structure to these lists, there is the option of using __text and __value (ref) as aliases so one value will be displayed and one will be used as the filter.

This datasource automatically throws an error whenever more than one field is returned when building this list (src) which prevents this functionality from working.

To Reproduce
Steps to reproduce the behavior:

  1. Be sure this datasource is installed in Grafana. I use a SQLite database for Grafana itself, so I set up the datasource to reference that database.
  2. In a dashboard, click the gear to access settings, then go to Variables
  3. Create a query variable with the name and label of users. "Show on dashboard" has "Label and value" selected.
  4. Select your SQLite datasource, and under query, add SELECT id AS __value, login AS __text FROM user
  5. Use defaults for everything else
  6. Either apply the variable or click "Run query"
  7. See the error about two fields

Versions (please complete the following information):

  • OS: OSX
  • Run via docker? No
  • Browser: Chrome
  • Grafana Version: main
  • Plugin Version: 3.3.2
  • Plugin installed via grafana-cli or manually? Installed via UI
@fr-ser
Copy link
Owner

fr-ser commented Dec 17, 2023

Thank you very much for the detailed report. I'll take a look at this 👌🏻

@fr-ser fr-ser added pending-closure This issue is stale and will be cleaned up and removed TODO something to be done when time allows labels Mar 8, 2024
@fr-ser
Copy link
Owner

fr-ser commented Mar 8, 2024

The support for this should be added via this PR: #133.

You can manually install v3.5.0 of the plugin right now to check it.

After a while (a couple of weeks usually) the plugin is also updated on the regular Grafana release channels

@github-actions github-actions bot removed the pending-closure This issue is stale and will be cleaned up label Mar 9, 2024
Copy link

github-actions bot commented Apr 8, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the pending-closure This issue is stale and will be cleaned up label Apr 8, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-closure This issue is stale and will be cleaned up
Projects
None yet
Development

No branches or pull requests

2 participants