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

Variables: Uppercase variable formatter #441

Open
korinekgergely opened this issue Nov 2, 2023 · 1 comment · May be fixed by #746
Open

Variables: Uppercase variable formatter #441

korinekgergely opened this issue Nov 2, 2023 · 1 comment · May be fixed by #746
Labels
help wanted Extra attention is needed type/enhancement New feature or request

Comments

@korinekgergely
Copy link

Hi,
I have a simple QueryVariable, like this:
function getVariable() { return new QueryVariable({ name: 'output', datasource: ABCD, query: SELECT blabla, hide: VariableHide.hideVariable, }); }

I use it as SceneVariableSet, like:
return new EmbeddedScene({ $variables: new SceneVariableSet({ variables: [ getVariable() ], }),...
For display I use it in a textPanel, like:
const textPanel = PanelBuilders.text() .setTitle("title") .setOption("content", "Variable: <b>${output}</b>" ).build()
Question: how can I modify the value of the variable (named 'output' here) before display it? It should be a string, I want manipulate that, like uppercase oder so.
Thank you in advance.

@torkelo
Copy link
Member

torkelo commented Nov 2, 2023

you have variable formats here https://grafana.com/docs/grafana/latest/dashboards/variables/variable-syntax/

We do not have an upper-case variable value formatter.

You could contribute it https://github.com/grafana/scenes/blob/main/packages/scenes/src/variables/interpolation/formatRegistry.ts

@torkelo torkelo added the type/enhancement New feature or request label Nov 2, 2023
@torkelo torkelo changed the title Modify QueryVariable Variables: Uppercase variable formatter Nov 2, 2023
@dprokop dprokop added the help wanted Extra attention is needed label Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed type/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants