The discussion revolves around enhancing the Data Explorer feature in Discourse to allow URL parameters to pre-fill query parameters. Nacho_Caballero initially proposed this idea to facilitate sharing queries with pre-filled parameters. sam welcomed the suggestion, marking it as a potential improvement. loginerror added suggestions for a &run parameter to automatically execute the report and parameters carrying user context. lucasbasquerotto cautioned about security implications of the &run parameter with same-site cookie settings. Nam implemented the feature, allowing parameters to be added to the URL after pressing ‘run’. markvanlan confirmed the PR was merged and asked if it met the original request. Nacho_Caballero expressed interest in extending this functionality to reports. markvanlan and Nacho_Caballero discussed generating URLs with parameters for group reports. Lhc_fl referenced a PR that addresses the report parameter functionality. hugh announced the addition of the &run parameter, which automatically runs the report upon page load, as documented in the Data Explorer plugin page.
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.
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.
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.
We circled back to this request and have now added a run paramater that will automatically run the report when the page is loaded. It is documented in the Data Explorer plugin page here: