I have a database that contains meta data for Confluence pages, referenced by the Confluence content id.
Is it possible to pass the content id of the current page to Pocket Query somehow, for example by using $content.getContentIdAsString()? The Bob Swift SQL plugin can do this.
Hi Arne,
In that case, you'd need a wildcard parameter for the macro browser. According to the PocketQuery documentation, the following wildcards are available:
Since there is currently no wildcard for the current page's ID, I implemented this improvement. Could you install this version of PocketQuery I created for you and test in the following way if it solves your issue...
Statement:
SELECT ... WHERE val = :pageid AND ...
Then in the macro browser, you simply enter @pageid for the variable "pageid". If it doesn't work, please check the "debug" checkbox in the macro browser and report the error message shown.
Note that :pageid will actually be transformed to a string. So your statement will become like this:
SELECT ... WHERE val = '50' AND ...
If this must be a number instead, I'll have to look for another way.
As soon as your issue is solved, I'll create a new release and upload it to the Marketplace. I'm looking forward to your feedback!
Regards, Felix (Scandio)
Excellent, the new version works and is exactly what we need. Thanks a lot.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Arne! I created the new version 1.14.7 and uploaded it to marketplace. You should replace the temporary version I sent you with this one. And if you like PocketQuery, we'd be very happy about a little review at the marketplace :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes I need the page id in the SQL query, not in the template. My query looks somehwat like 'SELECT ... WHERE val=$page.getContentId() AND ...'
Please advise how to pass the value from the template to the actual SQL query.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arne,
Thank you for your interest in PocketQuery! This should be easy to achieve if you already have a custom template, since you have the current page object available as $page. This is the object of type com.atlassian.confluence.pages.Page and you can call all available methods on it. In your case, this will most probably be getId() or getIdAsString().
If you need to pass the ID as macro parameter to a PocketQuery macro, things are a little differently. In that case, please let us know!
Regards, Felix (Scandio)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.