# How to trigger a sound when a database item is added

**URL:** <https://forum.bubble.io/t/how-to-trigger-a-sound-when-a-database-item-is-added/318422>\
**Category:** Plugins\
**Created:** [April 18, 2024, 9:51pm UTC](https://forum.bubble.io/t/how-to-trigger-a-sound-when-a-database-item-is-added/318422 "2024-04-18T21:51:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![raquel.r.baier](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@raquel.r.baier](https://forum.bubble.io/u/raquel.r.baier)\
**Post date:** [April 18, 2024, 9:51pm UTC](https://forum.bubble.io/t/how-to-trigger-a-sound-when-a-database-item-is-added/318422/1 "2024-04-18T21:51:39Z")

</div>

Hi, I am making an app that checks items in and out. I will use a library as an example.

Users can request to have books put on hold for them. The library has a list of all the books requested from their library, and each library has access to only the list of the books requested from their library, which is displayed on a Library Admin page. The list pulls from the Request Data type, which has a list of Books requested, the Library it’s associated with, a yes/no of if the Request is satisfied, and the User who requested the books. The list displays requests only for the Library currently looking at it and unsatisfied requests.

Users can create a Request Data, or the Library can create a custom one if the User did not request ahead.

I need a notification sound to play every time a User creates a Request Data (or every time a Request Data is made, if that’s easier) so the Library knows their request list has been updated. I’ve found multiple plug-ins to handle making the sound, I am just confused on where to put the sound in the workflow. Is it an API thing, or should it be on the Library Admin page? Will it only work if the page is open?

Thanks so much!

---

<div class="post-metadata">

**Author:** ![adam30](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/adam30/32/242266_2.png) [@adam30](https://forum.bubble.io/u/adam30)\
**Post date:** [April 19, 2024, 12:08am UTC](https://forum.bubble.io/t/how-to-trigger-a-sound-when-a-database-item-is-added/318422/2 "2024-04-19T00:08:16Z")

</div>

On your sound data type, you can have a yes/no field that is called soundPlayed, which defaults to “no”. You could then have a “do when condition is true” workflow on the page that searches for all sounds with soundPlayed as “yes” and if one exists, play a sound (using a audio player plugin) and then mark the record as soundPlayed equal to “yes”

Let me know if that makes sense

🔗 **Connect with me**

- **YouTube:** [https://www.youtube.com/channel/UCd5e2-d5OpFGK2pfOiglBSg](https://www.youtube.com/channel/UCd5e2-d5OpFGK2pfOiglBSg)
- **Instagram:** [Adam Goodyer (@adamfreelances) • Instagram photos and videos](https://www.instagram.com/adamfreelances/)
- **Twitter:** [https://twitter.com/adamfreelances](https://twitter.com/adamfreelances)
- **LinkedIn:** [https://www.linkedin.com/in/adam-goodyer/](https://www.linkedin.com/in/adam-goodyer/)

---

<div class="post-metadata">

**Author:** ![GH5T](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/gh5t/32/209141_2.png) [@GH5T](https://forum.bubble.io/u/GH5T)\
**Post date:** [April 19, 2024, 1:01am UTC](https://forum.bubble.io/t/how-to-trigger-a-sound-when-a-database-item-is-added/318422/3 "2024-04-19T01:01:49Z")

</div>

Take a look at this [demo](https://www.bappolis.com/plugin/tabby-nav#demo) I made for my Tabby Navigation plugin.

It does exactly what you want. Go to the last tab and click the button!

~ You dont need my plugin to do this but it’ll help 😉

---

<div class="post-metadata">

**Author:** ![raquel.r.baier](https://avatars.discourse-cdn.com/v4/letter/r/3ec8ea/32.png) [@raquel.r.baier](https://forum.bubble.io/u/raquel.r.baier)\
**Post date:** [April 22, 2024, 2:14am UTC](https://forum.bubble.io/t/how-to-trigger-a-sound-when-a-database-item-is-added/318422/4 "2024-04-22T02:14:03Z")

</div>

This worked! I took it a step farther and did “Do every X seconds” and then set the condition to do when true.

So what worked was Do every 30 seconds, Only when: Do a search for Notifications (where Library to sound = Current User’s Connected Library and Sound Played = “no”) :count is not 0.

Then for the Steps within the workflow I did Step 1 as the call to the plug-in to make a sound, and then Step 2 Made changes to Notification to set the “no” to “yes” (Search for Notifications (where Library to Sound = Current User’s Connected Library and Sound Played = “no”) :first item).

This way the page is constantly looking for new notifications so it knows to make a sound so the Library manager knows to look at the screen.

Thanks so much!

---

<div class="post-metadata">

**Author:** ![adam30](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/adam30/32/242266_2.png) [@adam30](https://forum.bubble.io/u/adam30)\
**Post date:** [April 22, 2024, 6:41am UTC](https://forum.bubble.io/t/how-to-trigger-a-sound-when-a-database-item-is-added/318422/5 "2024-04-22T06:41:22Z")

</div>

That’s great! I think you could use a “do when condition is true” and it should be instant and also save your page running a workflow every 30 seconds, but go with whatever works, that may well work better for your use case!

All the best 🙂
