# Invite Tracking

> How to create an invite tracking system

In this tutorial, you'll learn how to create a system to track who invited new members!

> This tutorial assumes you know the basics of inventor.bot- we recommend doing the [Ping Command](https://inventor.bot/docs/tutorials/ping-command) tutorial if you haven't already.

Create a new `invites` database with `code` and `count` columns

![SCR 20260515 khya](https://docs.inventorassets.com/3a530972-36c2-4e35-8a54-20b73c3055ef.png)

Make a new flow with the **Invite Created** trigger. Add a **Database Create Row** block that creates a row in the database with the outputs from the trigger.

![SCR 20260515 jynv](https://docs.inventorassets.com/317c6fd8-e804-4883-9004-c30d998c01c3.png)

Create a new flow with the **Member Join** trigger and add the **Get Server Invites** block with the **Server ID** output from the trigger.

![SCR 20260515 kblp](https://docs.inventorassets.com/36818c7c-4db9-45eb-90ae-7b40413e9afa.png)

Add a **Database Lookup (Single)** with these filters

* `code` equals **Get Server Invites - Invite Code**
* `count` less than **Get Server Invites - Invite Uses**

![SCR 20260515 kbyg](https://docs.inventorassets.com/09278151-54ef-4a24-bcbd-035b6e5e0483.png)

Add an **If Statement** and check if **Database Lookup (Single) - Found** is true.
![SCR 20260515 kcjr](https://docs.inventorassets.com/c0231b54-dd49-4264-9076-d799b94da6fe.png)

You can add anything you want inside this **If Statement**. In this example, we'll send a welcome message that includes info about who invited the new member using the **Get Server Invites** outputs, like **Invite Code** and **Invite Creator User ID**

![SCR 20260515 keyz](https://docs.inventorassets.com/787b1e5e-66da-4f6b-9358-fd9b38e2e1f6.png)

We also need to update the row using **Database Update Row**. Then we can stop looping over invites with **Break**.

![SCR 20260515 kecd](https://docs.inventorassets.com/7b943509-067d-4b23-84e7-714e3497158b.png)

Make sure both flows are published, then you can test it out!

![SCR 20260515 knbs 16x9](https://docs.inventorassets.com/27026704-c2fd-4f79-be73-4d525cdf70ac.webp)
