Query parameters are great for obvious reasons. When you make Data Explorer queries available to less-than-technical users though, they can sometimes be confused by the name (even if it’s just a variable name with an underscore).
Can you give an alias to a query parameter so it shows up with a nicer name below the query?
Yep, I have that now, but it’s just not as polished when you’re trying to make these reports friendly to very non-technical people in places like sales, marketing, etc.
In fact, it’d be nice if it went one step further and also gave you the option of defining a tooltip/info icon description as well.
Yeah, we run Tableau in our business and we do export all Discourse data so it can be used there.
But I do enjoy bringing users, including internally, into the platform. I always attempt to champion for less tools as much as possible and avoid too much sprawl.
One of the more simple solutions would be to check for an optional label variable in the current format you all use, e.g.:
-- [params]
-- text :user_group
-- label: "The Salesforce account name for the customer you want to look up in this query."
-- text :topic_id
Admittedly I haven’t been a full-time dev in over 5 years and going now, so I can’t pretend to know the specifics of the current implementation nor the possible complexities of this next suggestion…but it’d be awesome if you implemented Front Matter at the start of the SQL query. Front Matter can be yaml, toml, or even json and certainly looks prettier than the current implementation. It visually looks as though it’d be easier to add options too, in my opinion. A query with a theoretical Front Matter implementation might look something like this:
---
user_id:
description: "The Salesforce account name for the customer you want to look up in this query."
tooltip: "Get this from users Salesforce account, usually associated with their email domain. It should be an exact match."
topic_id:
description: "This is the ID of the topic you want to look into."
event_attendance_type:
default: 0
---
SELECT ue.user_id, u.name, u.title, ue.email
FROM discourse_post_event_invitees ei
JOIN posts p ON p.id = ei.post_id
JOIN user_emails as ue ON ei.user_id = ue.user_id
JOIN users as u on ei.user_id = u.id
WHERE p.topic_id = :topic_id
AND ei.status = 0