# Is it possible to give an alias to a query parameter?

**URL:** <https://meta.discourse.org/t/is-it-possible-to-give-an-alias-to-a-query-parameter/276643>\
**Category:** Product Support\
**Tags:** data-explorer\
**Created:** [August 25, 2023, 5:05pm UTC](https://meta.discourse.org/t/is-it-possible-to-give-an-alias-to-a-query-parameter/276643 "2023-08-25T17:05:34Z")\
**Posts on this page:** 1\
**Showing post:** 11

<div class="post-metadata">

**Author:** ![jordan-violet](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jordan-violet/32/281428_2.png) [@jordan-violet](https://meta.discourse.org/u/jordan-violet)\
**Post date:** [August 26, 2023, 12:05pm UTC](https://meta.discourse.org/t/is-it-possible-to-give-an-alias-to-a-query-parameter/276643/11 "2023-08-26T12:05:26Z")

</div>

So many options!

One of the more simple solutions would be to check for an optional label variable in the current format you all use, e.g.:

```plaintext
-- [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:

```plaintext
---
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

```

---

_[View the full topic](https://meta.discourse.org/t/is-it-possible-to-give-an-alias-to-a-query-parameter/276643)._
