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
Global variable can't be used as a filter value if that value is an integer #14198
Comments
Variables in filters are wrapped in quotes as such @jaycammarano Will the fix for #13943 be related to this issue? |
in 9.18.0 i still don't know how i can use variables in filters. i just want to filter based on an id. e.g. is this really not possible. i also tried it in quotes, no luck. |
@eikaramba can you try removing the quotes via the Raw Editor? Here's a quick example: chrome_bo8OIW6G51.mp4It should help ensure the filter is against an integer instead of a string. |
wuhu, that actually worked! Finally, so much power now via insights! 🎉 another entry for my little manual https://fork-appeal-054.notion.site/Directus-Missing-Manual-07cfbb75414b4fcb9401f4325701d61e#e81bb885ecff4e1d8624c515771b8053 |
Glad that works! Just in case you haven't notice, your use case might also benefit from the Global Relational Variable added via #15452 in
Thanks again for maintaining this list 👍 I'm pretty sure this is already in @erondpowell's radar, but tagged him once again just in case. 😄 |
Linear: ENG-240 |
Describe the Bug
At the Insights module, if you want to use a global variable specified by any global variable panel, you won't be able to use it at a filter which requires its value to be an integer.
Take for instance the following example:
Axis.-.Google.Chrome.2022-06-29.21-37-51.mp4
Here,
serial
(in contrast toproduct
) is an integer, and thus, you won't be able to use{{ serial }}
.To Reproduce
Make sure you have a collection with an integer field.
x
Next, try to create a panel which uses this collection. Third, create a filter and try to apply a filterx equals {{ var }}
. You will see that any string will be ignored here, and thus the value will be discarded, i.e.x equals ...
.Errors Shown
No response
What version of Directus are you using?
9.13.0
What version of Node.js are you using?
16.13.0
What database are you using?
Postgres 13
What browser are you using?
Chrome
How are you deploying Directus?
PaaS
The text was updated successfully, but these errors were encountered: