# Get list of invited users

**URL:** https://meta.discourse.org/t/get-list-of-invited-users/64184
**Category:** Feature
**Tags:** invites
**Created:** [June 8, 2017, 6:48pm UTC](https://meta.discourse.org/t/get-list-of-invited-users/64184 "2017-06-08T18:48:05Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 8, 2017, 6:48pm UTC](https://meta.discourse.org/t/get-list-of-invited-users/64184/1 "2017-06-08T18:48:05Z")

</div>

Because [required custom fields are not required for invites](https://meta.discourse.org/t/required-custom-fields-for-signup-are-not-required-for-invites/51155/6), a client wants to know who’s been invited. I don’t see an easy way to get that information. I thought that perhaps clicking “invited users” on the admin user page would do that, but it includes just my invites, not all invites.

Is there a way to do this? (Other than [data explorer](https://meta.discourse.org/t/32566?silent=true)?)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [June 8, 2017, 6:55pm UTC](https://meta.discourse.org/t/get-list-of-invited-users/64184/2 "2017-06-08T18:55:43Z")

</div>

This is a question for @techAPJ

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [June 8, 2017, 7:30pm UTC](https://meta.discourse.org/t/get-list-of-invited-users/64184/3 "2017-06-08T19:30:45Z")

</div>

> [@pfaffman](#):
>
> Is there a way to do this? (Other than [data explorer](https://meta.discourse.org/t/32566?silent=true)?)

What’s the issue with using [data explorer](https://meta.discourse.org/t/32566?silent=true)? A simple [data explorer](https://meta.discourse.org/t/32566?silent=true) query for this will list all the invited users in properly formatted (hyperlinked) UI and the result can be exported as needed.

Here is the [data explorer](https://meta.discourse.org/t/32566?silent=true) query if you are interested:

```plaintext
SELECT user_id,
       invited_by_id as invited_by_user_id,
       redeemed_at
FROM invites
WHERE redeemed_at IS NOT NULL
ORDER BY redeemed_at DESC

```

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [June 8, 2017, 7:45pm UTC](https://meta.discourse.org/t/get-list-of-invited-users/64184/4 "2017-06-08T19:45:39Z")

</div>

I’d already written a query for [data explorer](https://meta.discourse.org/t/32566?silent=true), I was just surprised that there wasn’t a way to do it without the [data explorer](https://meta.discourse.org/t/32566?silent=true). Since invites are in their own table, it’s not rocket science to write the query, but your query taught me that I could append `_user_id` to something to make it use the user displayer thing. That’s cool. Thanks.

---

<div class="post-metadata">

### Author: ![techAPJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/techapj/32/342990_2.png) [@techAPJ](https://meta.discourse.org/u/techAPJ)
#### Post date: [June 12, 2017, 3:40pm UTC](https://meta.discourse.org/t/get-list-of-invited-users/64184/5 "2017-06-12T15:40:46Z")

</div>

> [@pfaffman](#):
>
> Because required custom fields are not required for invites

Not anymore. 🙂

[https://github.com/discourse/discourse/commit/b9c94aa234fb6198a163ca2e990a3e0b209fbf90](https://github.com/discourse/discourse/commit/b9c94aa234fb6198a163ca2e990a3e0b209fbf90)

Demo:

 ![](https://global.discourse-cdn.com/meta/original/3X/6/2/62dba7c3a949fe4313e0a444b5dfc7e80587420a.png)

---

<div class="post-metadata">

### Author: ![jimkleiber](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jimkleiber/32/121814_2.png) [@jimkleiber](https://meta.discourse.org/u/jimkleiber)
#### Post date: [December 2, 2023, 6:13am UTC](https://meta.discourse.org/t/get-list-of-invited-users/64184/6 "2023-12-02T06:13:12Z")

</div>

Heads up, this one no longer seems to work, however, the one below works for me:

[https://meta.discourse.org/t/list-of-users-who-signed-up-via-invitations/224871/6](https://meta.discourse.org/t/list-of-users-who-signed-up-via-invitations/224871/6)

> [@Use data explorer to get a list of users who signed up via invitations](https://meta.discourse.org/t/use-data-explorer-to-get-a-list-of-users-who-signed-up-via-invitations/224871/6):
>
> My SQL skills are still a little fledgling, but try this one and see if I’ve got the look-ups working properly: 🙂
> 
> ```plaintext
> SELECT u1.username AS invitee, 
> u2.username AS inviter,
> iu.redeemed_at
> FROM invited_users iu
> JOIN invites i ON iu.invite_id = i.id
> JOIN users u1 ON iu.user_id = u1.id
> JOIN users u2 ON i.invited_by_id = u2.id
> WHERE iu.redeemed_at IS NOT NULL
> ORDER BY iu.redeemed_at DESC
> 
> ```
