I've been looking around documentation for PocketQuery to find information on dynamic parameters using REST API queries but I can only seem to find examples for SQL queries. What I would like to do is enable dynamic parameters on my REST query so I can search through a list of names in a contact database without having to load up the entire database and just using a Table Filter macro. I see that in order to add in dynamic parameters you have to add in pq_ before the variable, but I am trying to filter on one of the columns that I am already pulling with my converter.
Can anyone help out?
Hi @Ryan Davis
dynamic parameters are a macro option and don't have much to do with your query itself. By enabling dynamic parameters you're telling PocketQuery to look for parameters in the URL of your page to use in your query. So for example in this URL:
PocketQuery will pick up the year parameter and set it to 2019 if one of your queries in that page has a year parameter. Also see here for a further explanation.
I think what you are actually looking for are probably query parameters. You can define a query parameter in you query by using the colon syntax (e.g.: :myparam). This works both for SQL:
WHERE name = :name
By the way: You can also use so called wildcards. For example, if you want the name of the current page filled in automatically you could do:
Hope that helps! :)
We're just testing your pocket query addon.
Is it possible to pass a parameter directly to a SQL statement without filling the parameter field in the Pocket Query macro.
So far I've only managed to do it this way
In the query
Select * from Bla where user = :userFullName
userFullName = String
and must then set the parameter
userFullName = @userFullName
so that the logged in user can see his data.
In your example above
seems as if you could pass the parameters directly through or only refers to the REST call because the SQL statement doesn't work like this
Select * from Bla where user = :@userFullName
Yes, this is exactly what wildcards in Query statements are for! See them in the documentation: https://help.scandio.de/documentation/display/PQDOC/Queries#Queries-UsingParametersinQueries
:@userFullName may not work because wildcards might be case sensitive if I remember correctly. Have you also tried :@userfullname?
Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events