Populate Data Explorer params with URL params

It would be great if I could share a Data Explorer query with a group and have the query params be pre-filled with the URL params.

For example, if I have this param -- string :username, I should be able to share it with group “my-group” with username “myName”.

Something like this:

https://mydomain.com/g/my-group/reports/100?username=myName

11 Likes

Sure … putting a #pr-welcome on this, seems like a nice quality of life change!

4 Likes

Bumping the topic with one more suggestion:

  • having a &run parameter that will fire report upon page load, to save user a click
  • having set of parameters that would carry user context (this way you could auto-insert the username of the current user, for example)

We would like this feature because it would allow us to easily automate internal notifications for topics for each interested user :slight_smile:

4 Likes

It’s just important to note that if a run parameter is added, it should not be used if the same-site cookie is set to None (or Disabled and the browser defines None as the default).

If the same-site is none, you could enter some other site and they could make a http GET request, in the same way that CSRF is exploited, although this would not be a CSRF vulnerability per se, but they could execute some really expensive instructions in the data explorer.

The same-site cookie policy is relatively new, but the major browsers already support it for some time, Chrome defaults to Lax, and Discourse too (if I’m not wrong), so it should not be a problem in most cases.

I added the Data Explorer params to the URL. The Params are added when the user press ‘run’ button.
This is the example after press ‘run’:



and here is the link for the PR:

6 Likes

The PR linked above was merged. Does this accomplish what you were looking for? You have to run the query to have the query params added to the URL, so you can run it, copy the link, and share.

3 Likes

@GH_Nam Thanks for your work on this!

This currently works for queries run in the Data explorer, but I wonder if it would be possible to make this work as a report. Something like:

mysite.com/g/my-group/reports/6&params=%7B"months_ago"%3A"3"%7D

2 Likes

We could add support for filling the inputs on the groups report run page, with params from the URL. That wouldn’t be difficult at alI. The question I have is, how do you get this URL? Is it generated for a given group somehow, or are you just manually generating the URL?

If you go to the group page, you’ll see a “Reports” tab with links to the queries that are available for that group, but the params would probably have to generated manually.

1 Like

Okay, I’ll add support for filling in the inputs in the groups report show page, with params from the URL.

5 Likes