# Can we pull emails from private group

**URL:** <https://meta.discourse.org/t/can-we-pull-emails-from-private-group/197781>\
**Category:** Product Support\
**Created:** [July 21, 2021, 5:14pm UTC](https://meta.discourse.org/t/can-we-pull-emails-from-private-group/197781 "2021-07-21T17:14:11Z")\
**Posts on this page:** 5\
**Page:** 1

## AI-generated summary

Campbell_Mccallum [inquires](/t/-/197781/1) about extracting contacts from a specific private group within Discourse, noting that standard exports do not distinguish between private and public groups. HAWK [suggests](/t/-/197781/2) using the Data Explorer plugin to write SQL queries for this purpose and offers further assistance via email for hosted customers. Osh attempts to create an ad hoc query but struggles to locate the correct group table to join, showing a screenshot where the WHERE clause is blank and no tables are available. michebs [provides](/t/-/197781/5) the solution, identifying the `group_users` table as the key relationship table that connects users to groups, which should allow for the necessary data extraction.

<div class="post-metadata">

**Author:** ![Campbell\_Mccallum](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/campbell_mccallum/32/213077_2.png) [@Campbell\_Mccallum](https://meta.discourse.org/u/Campbell_Mccallum)\
**Post date:** [July 21, 2021, 5:14pm UTC](https://meta.discourse.org/t/can-we-pull-emails-from-private-group/197781/1 "2021-07-21T17:14:11Z")

</div>

Hi Discourse.

We are able to export all contacts from our main community but unable to pull just a private group. When pulling the whole lot it doesn’t separate into private groups.

Is there a way to just pull a private group.

All the best,  
Campbell

---

<div class="post-metadata">

**Author:** ![HAWK](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hawk/32/86627_2.png) [@HAWK](https://meta.discourse.org/u/HAWK)\
**Post date:** [July 21, 2021, 11:25pm UTC](https://meta.discourse.org/t/can-we-pull-emails-from-private-group/197781/2 "2021-07-21T23:25:04Z")

</div>

Hi Campbell,  
Sure thing – you have access to the [Data Explorer](https://meta.discourse.org/t/32566?silent=true) plugin which allows you to write SQL queries to pull any data at all that is stored in the database.

Because you are a hosted customer you are welcome to ping us on [team@discourse.org](mailto:team@discourse.org) if you need more support finding this.

---

<div class="post-metadata">

**Author:** ![Osh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osh/32/228247_2.png) [@Osh](https://meta.discourse.org/u/Osh)\
**Post date:** [July 22, 2021, 1:10pm UTC](https://meta.discourse.org/t/can-we-pull-emails-from-private-group/197781/3 "2021-07-22T13:10:55Z")

</div>

Hi at @HAWK

I’ve been trying to ad hoc write a query to pull this but am unable to find the specific group in our Groups table to inner join.

 ![image](https://global.discourse-cdn.com/meta/original/3X/8/4/84d665cc5e5cc9596ed6f64aed134b849a2cb862.png)

Do you know where I can find this?

---

<div class="post-metadata">

**Author:** ![Osh](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/osh/32/228247_2.png) [@Osh](https://meta.discourse.org/u/Osh)\
**Post date:** [July 22, 2021, 1:11pm UTC](https://meta.discourse.org/t/can-we-pull-emails-from-private-group/197781/4 "2021-07-22T13:11:48Z")

</div>

You can see the WHERE section is blank and on the right we have no tables available

---

<div class="post-metadata">

**Author:** ![michebs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/michebs/32/190102_2.png) [@michebs](https://meta.discourse.org/u/michebs)\
**Post date:** [July 22, 2021, 1:54pm UTC](https://meta.discourse.org/t/can-we-pull-emails-from-private-group/197781/5 "2021-07-22T13:54:33Z")

</div>

The table that makes the relationship between the `users` and `group` tables is the `group_users` table.
