Data Explorer Plugin


(Jeremy M (Jerdog)) #108

What about a query to count how many times content has been shared? So:

  • Total Count of content shares by month
  • Highest shared content by month
  • User sharing the most content by month

(Rob Meade) #109


Ok, it’s fairly minor and doesn’t prevent functionality, it’s just a little erk-some…

On browseing to the Data Explorer;

“There are no queries. Why not create one?”

Yet the drop-down menu, in our case, currently yields three;

Perhaps this could be updated to say something like;
“No query selected. Would you like to create one?”

I don’t think there is value in returning the number of queries that have been created. Suggestion only…

(Rob Meade) #110

Feature Request

The dropdown menu of existing queries orders them in the order in which they were created, it would be nice if they could be ordered alphabetically, either instead, or as well as (configurable?);


(Jeremy M (Jerdog)) #111

Does this plugin present any new API endpoints, i.e. if we wanted to access the data from the query via the API?

(Jay Pfaffman) #112

Probably so. See

(Simon Cossar) #113

Yes, to get the data from a query you need to know the query’s ID. You can see the ID in the browser’s address bar when you run a query. To make an API request for the data you can do a query like this with CURL, with $api_key and $api_username set to the API credentials from your site and $query_id set to the query’s id.

curl -X POST -d "api_key=$api_key&api_username=$username"$query_id/run

It looks like it’s also possible to create queries through the API. I haven’t tried that yet though.

(Markus) #114

Hi friends,
is it possible to list all attachments via Data Explorer plugin and show some additional infos like:

  • File Size (MB)
  • linked posts
  • download / click counter
  • filetype
  • user who uploaded the file

This would be a great snippet for daily usage.

Thanks in advance!

(Gökhan Gurbetoğlu) #115

Is it possible to add an option to enable this for moderators? Any of these options:

  1. Allow moderators to create new queries and use them.
  2. Allow moderators to use only the queries created by the admins.

Especially an option to enable second one would be very useful. I want to let my moderators to run queries from time to time since I am mostly responsible for technical aspects of the forum but our moderators are the ones who know what is going on around the forum more than the admins.


At the moment, no, but we are working on surfacing approved queries (built by admins) onto the moderation dashboard to give mods the ability to run them. I don’t have a hard ETA on that though sorry.

(Brendan Schlagel) #117

Love this plugin so far! One thing that’s confused me is the implicit limits I see mentioned a couple places. Agree w/ the following that this could be made more clear.

Is there any way to override this limit of only showing 250 query results in the UI?

I tried adding a limit parameter but that doesn’t seem to affect the UI display so seems that’s only relevant for API calls. (Though that’s also good to know!)

(Kane York) #118

You can use the Download CSV button to get more results.

The intention of the rule that “the limit must be finite” is that you should acknowledge, by writing down a number, that the query might actually return that many results and you are prepared to handle it.

The JS app is not prepared to handle it, according to the testing I did when I determined the default limit of 250 :slight_smile:

But yeah I think that adding a small message when the limit is returned would be nice.

(Brendan Schlagel) #119

Cool that all makes sense! Just had me banging my head against the wall for a few minutes thinking my query was broken before I realized the implicit limit :smiley:

I think a message at the bottom like “Displaying max. 250 out of [x] total results” would help clarify. Not sure if it’d be easy to show total count of results like that while limiting # displayed. Ultimately I want to pull some data externally with an API call but the UI version is super nice + easier for writing and testing out queries.

(Gerhard Schlager) #120

Done. Sort queries alphabetically · discourse/discourse-data-explorer@4de3b1d · GitHub
Nice side effect: It also fixes random build errors. :slight_smile:

(Rob Meade) #121

Fab! Many thanks for this :slight_smile: