# “First post” badge!

**URL:** https://meta.discourse.org/t/first-post-badge/276674
**Category:** Data & reporting
**Tags:** sql-triggered-badge
**Created:** [January 15, 2015, 4:30am UTC](https://meta.discourse.org/t/first-post-badge/276674 "2015-01-15T04:30:06Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![PJH](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pjh/32/39071_2.png) [@PJH](https://meta.discourse.org/u/PJH)
#### Post date: [January 20, 2015, 12:05am UTC](https://meta.discourse.org/t/first-post-badge/276674/2 "2015-01-20T00:05:16Z")

</div>

> [@soyuri](#):
>
> Can someone please help me with the SQL and everything if I wanted to do one for “First post” badge!

You mean the first public post that they ever make to your forum?

1. /admin/badges
2. + New
3. Give your badge a name
4. Pick an icon. The font-awesome names can be found [here](http://fortawesome.github.io/Font-Awesome/cheatsheet/) (`fa-pencil-square` for example) or use a hosted image. This will be used on the various badges pages dotted around your site.
5. Pick an (optional) image. You can use the same as the previous step. This image will appear on user cards.
6. Select a badge type. For this you’d probably want Bronze.
7. Pick a group (or create a new group for it first.)
8. Give your badge a description
9. Enter the following sql

```sql
SELECT MIN(bp.id) post_id, bp.user_id, MIN(bp.created_at) granted_at
FROM badge_posts bp
WHERE (:backfill OR bp.id IN (:post_ids) )
GROUP BY bp.user_id

```

1. You probably want the following options checked:  
 ![](https://global.discourse-cdn.com/meta/original/3X/3/9/39bfb3ba37b562946b2e636854afe3f9e2b3d4ed.png)
2. Save your badge and [refresh the page to get more options](https://meta.discourse.org/t/testing-badge-sql-query/24195) between the SQL and the options shown above and you probably want the following  
 ![](https://global.discourse-cdn.com/meta/original/3X/5/c/5cb99bf75374467c0a9ec61a0a7949dbec828703.png)

---

_[View the full topic](https://meta.discourse.org/t/first-post-badge/276674)._
