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

[FEATURE] Handle passing variables to Dimension Filter #97

Open
elanon1 opened this issue Nov 6, 2023 · 7 comments
Open

[FEATURE] Handle passing variables to Dimension Filter #97

elanon1 opened this issue Nov 6, 2023 · 7 comments
Assignees
Labels
enhancement New feature or request

Comments

@elanon1
Copy link

elanon1 commented Nov 6, 2023

I think it is not possible to pass variables to Dimension Filter value currently, are there any plans to add this feature?

@elanon1 elanon1 added the enhancement New feature or request label Nov 6, 2023
@NithyaMenon
Copy link

+1 from me, was just about to log this feature request.

@lcc3108
Copy link
Member

lcc3108 commented Nov 8, 2023

I think it's right, but do you think it's right that you want to use the Variable below?
image


Link for myself
https://grafana.com/developers/plugin-tools/create-a-plugin/extend-a-plugin/add-support-for-variables#interpolate-variables-in-data-source-plugins

@lcc3108 lcc3108 self-assigned this Nov 15, 2023
@pebg-cmonetiquette
Copy link

+1 It would help me to have this feature

@lcc3108 lcc3108 mentioned this issue Jul 15, 2024
@fokion
Copy link

fokion commented Jul 19, 2024

any updates on this? Do you need help working on this?

@lcc3108
Copy link
Member

lcc3108 commented Jul 19, 2024

We have done some work on the dimension filter at the moment.

Additional work is always welcome.

@RubenSGoosen
Copy link

RubenSGoosen commented Sep 25, 2024

+1 Having an issue with passing variable to dimensionFilter. Using IN_LIST filter type. As they are string separated, I pass my variable "var" as such: ${var:csv}. The expected json payload should look something like:

dimensionFilter:Object
orGroup:Object
expressions:Array[1]
0:Object
filter:Object
fieldName:"campaignName"
filterType:"IN_LIST"
inListFilter:Object
caseSensitive:true
values:Array[2]
0:"xxxx"
1:"yyyy"

It appears that, passing a variable to dimensionFilter handles the entire variable as a single string - It simply does not pickup the comma separators. Below is the json payload that is returned:

dimensionFilter:Object
orGroup:Object
expressions:Array[1]
0:Object
filter:Object
fieldName:"campaignName"
filterType:"IN_LIST"
inListFilter:Object
caseSensitive:true
values:Array[1]
0:"xxxx, yyyy"

@lcc3108
Copy link
Member

lcc3108 commented Sep 27, 2024

+1 Having an issue with passing variable to dimensionFilter. Using IN_LIST filter type. As they are string separated, I pass my variable "var" as such: ${var:csv}. The expected json payload should look something like:

dimensionFilter:Object orGroup:Object expressions:Array[1] 0:Object filter:Object fieldName:"campaignName" filterType:"IN_LIST" inListFilter:Object caseSensitive:true values:Array[2] 0:"xxxx" 1:"yyyy"

It appears that, passing a variable to dimensionFilter handles the entire variable as a single string - It simply does not pickup the comma separators. Below is the json payload that is returned:

dimensionFilter:Object orGroup:Object expressions:Array[1] 0:Object filter:Object fieldName:"campaignName" filterType:"IN_LIST" inListFilter:Object caseSensitive:true values:Array[1] 0:"xxxx, yyyy"

@RubenSGoosen

I tested it and it's a bug.
�I didn't consider the array in replacing the variable

Until it's resolved,Maybe using ${var:regex} in the string filter full_regex will have the same effect.(Test is required.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants