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

How to share queries with a parameter #7404

Open
kate-gallo opened this issue Apr 29, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@kate-gallo
Copy link

commented Apr 29, 2019

I want to create a url so that I can access a Superset query from documentation.

For example, I'd like to share this query:

SELECT *
FROM {{ url_param('table_name') }}
LIMIT 100;

Assume the saved query has a savedQueryId=1234.

Is there any way to add parameters in the sharable link, as for example:
https://localhost/superset/sqllab?savedQueryId=1234&table_name=sales
so that when I open the link the parameter is kept?

Is there any other way to create link to superset queries programmatically?

@issue-label-bot issue-label-bot bot added the #question label Apr 29, 2019

@issue-label-bot

This comment has been minimized.

Copy link

commented Apr 29, 2019

Issue-Label Bot is automatically applying the label #question to this issue, with a confidence of 0.87. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@arpit-agarwal

This comment has been minimized.

Copy link
Contributor

commented May 8, 2019

Which version of superset you are using?
"PoP Tab link" is the one you are asking for. copy the link address.
SQLLAB=> Saved Query
Screenshot 2019-05-08 at 10 22 12 AM

To achieve parameter parsing you may need to enhance the superset and contribute back as PR

@kate-gallo

This comment has been minimized.

Copy link
Author

commented May 8, 2019

Hi
I am using version 0.25.6

I copied the link you said, so I have something like
https://superset.internal.intercom.io/superset/sqllab?savedQueryId=1234.

If I add a parameter to this link, as
https://superset.internal.intercom.io/superset/sqllab?savedQueryId=1234&table_name=sales and enter it to the browser, the parameter is not preserved, and when I run the query I get
relation "none" does not exist.

If I add the parameter from Superset once I already opened the query
https://superset.internal.intercom.io/superset/sqllab?table_name=sales,
it works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.