# Help with database condition

**URL:** <https://forum.bubble.io/t/help-with-database-condition/241672>\
**Category:** Need help\
**Created:** [January 16, 2023, 3:39am UTC](https://forum.bubble.io/t/help-with-database-condition/241672 "2023-01-16T03:39:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![notjrag](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/notjrag/32/154340_2.png) [@notjrag](https://forum.bubble.io/u/notjrag)\
**Post date:** [January 16, 2023, 3:39am UTC](https://forum.bubble.io/t/help-with-database-condition/241672/1 "2023-01-16T03:39:41Z")

</div>

Hi guys, just need a little help on this one. So i created another datatable for registration emails named “Application Form” - which consists of just 2 data fields: Email and doesExist. Email is obviously for the email input so we can send an email upon registration. The doesExist is a yes/no data type wherein if for example i used [email@email.com](mailto:email@email.com) and decide to use it again, it will be flagged as doesExist = Yes and it will show an error that this email has already been used.

How do i go about adding this Only When condition? Its a little hard as its not Current User data. Do i use “do search for” instead? Thank you in advance!

---

<div class="post-metadata">

**Author:** ![tylerboodman](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/tylerboodman/32/242142_2.png) [@tylerboodman](https://forum.bubble.io/u/tylerboodman)\
**Post date:** [January 16, 2023, 3:50am UTC](https://forum.bubble.io/t/help-with-database-condition/241672/2 "2023-01-16T03:50:14Z")

</div>

Well the fact that a database item is in your database means it already exists…

So when they go to enroll their email have the condition on that workflow: `Do a search for Application Form` with the constraint `Email = Input's value` then do `:count is 0` (meaning it looked for entries with that email and found 0). No need for the doesExist field.

You would want some feedback for the user though if an email already is registered, so you just need a 2nd workflow on the same button. Right click → Copy/paste the workflow and delete the actions on one of them, then make the condition `:count > 0`. Meaning it found at least 1 entry with that email already. Then have it show some red text that it’s registered already.

---

<div class="post-metadata">

**Author:** ![notjrag](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/notjrag/32/154340_2.png) [@notjrag](https://forum.bubble.io/u/notjrag)\
**Post date:** [January 16, 2023, 4:20am UTC](https://forum.bubble.io/t/help-with-database-condition/241672/3 "2023-01-16T04:20:12Z")

</div>

Oh my god thank for that that 2nd workflow! I cant figure out the counter operation for the count is 0. THANK YOU THANK YOU! YOU SAVED ME! I REALLY need to get used to these only when conditions more.

Thank you once again, @tylerboodman

---

<div class="post-metadata">

**Author:** ![ksplinter007](https://sea1.discourse-cdn.com/bubble/user_avatar/forum.bubble.io/ksplinter007/32/157751_2.png) [@ksplinter007](https://forum.bubble.io/u/ksplinter007)\
**Post date:** [January 16, 2023, 4:57am UTC](https://forum.bubble.io/t/help-with-database-condition/241672/4 "2023-01-16T04:57:47Z")

</div>

just remember…instead of “if,then” is “only when”! haha

---

<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:** [March 27, 2023, 3:40am UTC](https://forum.bubble.io/t/help-with-database-condition/241672/5 "2023-03-27T03:40:03Z")

</div>

Closed on March 27, 2023, 3:40am UTC

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