# Automatically Apply Badges to Group Members (in Hosted Version)

**URL:** <https://meta.discourse.org/t/automatically-apply-badges-to-group-members-in-hosted-version/63728>\
**Category:** Product Support\
**Created:** [1 ביוני,‏ 2017,‏ 11:58am UTC](https://meta.discourse.org/t/automatically-apply-badges-to-group-members-in-hosted-version/63728 "2017-06-01T11:58:29Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![scombs](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scombs/32/48616_2.png) [@scombs](https://meta.discourse.org/u/scombs)\
**Post date:** [3 באוקטובר,‏ 2017,‏ 2:57am UTC](https://meta.discourse.org/t/automatically-apply-badges-to-group-members-in-hosted-version/63728/6 "2017-10-03T02:57:08Z")

</div>

Here is the badge SQL, just replace your\_group\_name

```
select user_id, created_at granted_at, NULL post_id
from group_users
where group_id = (
  select g.id from groups g where g.name = 'your_group_name'
)

```

---

_[View the full topic](https://meta.discourse.org/t/automatically-apply-badges-to-group-members-in-hosted-version/63728)._
