# Trigger event when new row in Database

**URL:** <https://forum.bubble.io/t/trigger-event-when-new-row-in-database/234452>\
**Category:** Database\
**Created:** [November 28, 2022, 11:35am UTC](https://forum.bubble.io/t/trigger-event-when-new-row-in-database/234452 "2022-11-28T11:35:16Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![petit-ricard](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@petit-ricard](https://forum.bubble.io/u/petit-ricard)\
**Post date:** [November 28, 2022, 11:35am UTC](https://forum.bubble.io/t/trigger-event-when-new-row-in-database/234452/1 "2022-11-28T11:35:16Z")

</div>

Hello team,

I need to send emails when there is a new data in my Bubble Data Base.

So far, Zapier (Google Sheet/ Bubble) automation create a new row from google sheet to bubble.

The Google sheet stores: Firstname, lastname and email of customers.

I am looking for a way to detect this new data creation in Bubble so I can send an email automatically to the customer.

How to detect automatically there is a new item in my databse and trigger a workflow base don this condition ?

Thanks

---

<div class="post-metadata">

**Author:** ![sat\_miha](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/sat_miha/32/58187_2.png) [@sat\_miha](https://forum.bubble.io/u/sat_miha)\
**Post date:** [November 28, 2022, 11:52am UTC](https://forum.bubble.io/t/trigger-event-when-new-row-in-database/234452/2 "2022-11-28T11:52:35Z")

</div>

In the bubble backend API workflow there is an option called “database triggers”.

It can start workflow once a new row is created or **changed** , make sure you added proper conditionals to make workflow triggers only once it’s needed

---

<div class="post-metadata">

**Author:** ![petit-ricard](https://avatars.discourse-cdn.com/v4/letter/p/76d3ee/32.png) [@petit-ricard](https://forum.bubble.io/u/petit-ricard)\
**Post date:** [November 28, 2022, 11:58am UTC](https://forum.bubble.io/t/trigger-event-when-new-row-in-database/234452/3 "2022-11-28T11:58:36Z")

</div>

thanks @sat_miha I understand how to use this “database triggers” when a data changes but not when there is a new data.

Could you please help me ? 🙂

---

<div class="post-metadata">

**Author:** ![adamhholmes](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/adamhholmes/32/100510_2.png) [@adamhholmes](https://forum.bubble.io/u/adamhholmes)\
**Post date:** [November 28, 2022, 12:26pm UTC](https://forum.bubble.io/t/trigger-event-when-new-row-in-database/234452/4 "2022-11-28T12:26:12Z")

</div>

Use ‘Thing before change is empty’

[Trigger Event - Bubble Docs](https://manual.bubble.io/core-resources/events/trigger-event#trigger-event)

---

<div class="post-metadata">

**Author:** ![sat\_miha](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/sat_miha/32/58187_2.png) [@sat\_miha](https://forum.bubble.io/u/sat_miha)\
**Post date:** [November 28, 2022, 12:32pm UTC](https://forum.bubble.io/t/trigger-event-when-new-row-in-database/234452/5 "2022-11-28T12:32:54Z")

</div>

“Database triggers” triggers when data is created or changed.  
This workflow will start if the record in the database User created or changed  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/b/b/bb8e6f7ece1cda4804532245ef17d42f506dbcc5.png)  
This workflow will start only in the user record has a unique id (that means that the record exist and it’s not a new data), so we can be assured that this workflow will start only if the record exists

![image](https://us1.discourse-cdn.com/bubble/original/3X/b/2/b23e900dfac9b972baf45814d569a72f9bb5854a.png)  
This workflow will start only if the User doesn’t have the unique id(since no record can be created without a unique id, you can assume that this record is new data)  
 ![image](https://us1.discourse-cdn.com/bubble/original/3X/b/2/b2a4e34415206da3ba0f23e1e380b3ca1c848bb7.png)
