# Search database daily and send email if conditions are true

**URL:** <https://forum.bubble.io/t/search-database-daily-and-send-email-if-conditions-are-true/246535>\
**Category:** Need help\
**Created:** [February 12, 2023, 4:50pm UTC](https://forum.bubble.io/t/search-database-daily-and-send-email-if-conditions-are-true/246535 "2023-02-12T16:50:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![LA81638](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@LA81638](https://forum.bubble.io/u/LA81638)\
**Post date:** [February 12, 2023, 4:50pm UTC](https://forum.bubble.io/t/search-database-daily-and-send-email-if-conditions-are-true/246535/1 "2023-02-12T16:50:39Z")

</div>

How would I create a workflow that searches the database daily and, if certain conditions were true, then it would trigger an action, like send an email?

Any help appreciated!

Many thanks

---

<div class="post-metadata">

**Author:** ![dbevan](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/dbevan/32/157741_2.png) [@dbevan](https://forum.bubble.io/u/dbevan)\
**Post date:** [February 12, 2023, 5:01pm UTC](https://forum.bubble.io/t/search-database-daily-and-send-email-if-conditions-are-true/246535/2 "2023-02-12T17:01:31Z")

</div>

1. In the backend workflows, create a workflow.
2. In that workflow, make sure the last step schedules this workflow to be ran 1 day from the time it was run.
3. Create a test page and add a button.
4. Also add a date/time picker.
5. Create a workflow for this button. When the button is clicked, schedule the backend workflow you created. It should be scheduled for the time set in your date/time picker.

---

<div class="post-metadata">

**Author:** ![LA81638](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@LA81638](https://forum.bubble.io/u/LA81638)\
**Post date:** [February 12, 2023, 5:13pm UTC](https://forum.bubble.io/t/search-database-daily-and-send-email-if-conditions-are-true/246535/3 "2023-02-12T17:13:13Z")

</div>

Thanks for this @dbevan .

Is there a way it can run without me needing to press a button everyday?

---

<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:** [February 12, 2023, 5:30pm UTC](https://forum.bubble.io/t/search-database-daily-and-send-email-if-conditions-are-true/246535/4 "2023-02-12T17:30:19Z")

</div>

You don’t need to press a button every day… just once to start it running.

---

<div class="post-metadata">

**Author:** ![LA81638](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@LA81638](https://forum.bubble.io/u/LA81638)\
**Post date:** [February 12, 2023, 5:51pm UTC](https://forum.bubble.io/t/search-database-daily-and-send-email-if-conditions-are-true/246535/5 "2023-02-12T17:51:57Z")

</div>

Oh yes, that makes sense now you’ve said it!! Thanks guys, this has helped tremendously

---

<div class="post-metadata">

**Author:** ![LA81638](https://avatars.discourse-cdn.com/v4/letter/l/f05b48/32.png) [@LA81638](https://forum.bubble.io/u/LA81638)\
**Post date:** [February 12, 2023, 5:52pm UTC](https://forum.bubble.io/t/search-database-daily-and-send-email-if-conditions-are-true/246535/6 "2023-02-12T17:52:14Z")

</div>

Also, if anyone finds this thread this video has just helped me out too:

[![](https://img.youtube.com/vi/7cNWiA_tRvU/maxresdefault.jpg "Recursive workflows in Bubble (OR, HOW TO LOOP THROUGH A LIST)") ](https://www.youtube.com/watch?v=7cNWiA_tRvU)

But the answers from the wonderful guys above have explained how to set it working daily

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/bubble/original/3X/2/8/2847faa74692c2ffa5d939d3dc3724cdd060d247.png) [@system](https://forum.bubble.io/u/system)\
**Post date:** [April 23, 2023, 4:50pm UTC](https://forum.bubble.io/t/search-database-daily-and-send-email-if-conditions-are-true/246535/7 "2023-04-23T16:50:59Z")

</div>

Closed on April 23, 2023, 4:50pm UTC

This topic was automatically closed after 70 days. New replies are no longer allowed.
