# On Submit Action Rollback

**URL:** <https://community.glideapps.com/t/on-submit-action-rollback/24429>\
**Category:** Ask for Help\
**Created:** [March 18, 2021, 7:37am UTC](https://community.glideapps.com/t/on-submit-action-rollback/24429 "2021-03-18T07:37:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lin\_Altshuler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lin_altshuler/32/32591_2.png) [@Lin\_Altshuler](https://community.glideapps.com/u/Lin_Altshuler)\
**Post date:** [March 18, 2021, 7:37am UTC](https://community.glideapps.com/t/on-submit-action-rollback/24429/1 "2021-03-18T07:37:24Z")

</div>

Is there way to perform an action in the submit action the will rollback the form submittion if certain conditions apply?  
I need to check a new user form against existing emails (also not a feature maybe for private don’t know…) but if the email exists I don’t the form to be submitted and only show a notification of failure.

I know I can custom a detail screen with buttons and add row actions to do this, but seams like the submit action is made for these kind of actions.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 18, 2021, 7:58am UTC](https://community.glideapps.com/t/on-submit-action-rollback/24429/2 "2021-03-18T07:58:26Z")

</div>

Create a relation between the column that’s storing the input value and the destination column in your users table. If that relation is not empty, then you have a duplicate.

---

<div class="post-metadata">

**Author:** ![Lin\_Altshuler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lin_altshuler/32/32591_2.png) [@Lin\_Altshuler](https://community.glideapps.com/u/Lin_Altshuler)\
**Post date:** [March 18, 2021, 8:37am UTC](https://community.glideapps.com/t/on-submit-action-rollback/24429/3 "2021-03-18T08:37:35Z")

</div>

yes good idea for the validation. but the new row will still be added to the list if I understand correctly.  
I can later delete this row in GS script but I need to inform the user submitting the form that there is a duplicate and reenter the email.  
seems like a lot of workarounds for a simple “don’t submit if” action isn’t it?

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 18, 2021, 8:48am UTC](https://community.glideapps.com/t/on-submit-action-rollback/24429/4 "2021-03-18T08:48:41Z")

</div>

Sorry, I was on my mobile when I wrote the earlier response, so it was a little terse.

The idea with the relation is to prevent the form submission in the first place.  
If you’re using the native form then options in this regard may be limited, but at the very least you could have a warning (Hint component?) that has a visibility condition that causes it to appear when that relation is not empty.

If you’re creating your own form with your own custom submit button, then you have full control and can explicitly prevent a new row from being added if it would create a duplicate.

---

<div class="post-metadata">

**Author:** ![Lin\_Altshuler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/lin_altshuler/32/32591_2.png) [@Lin\_Altshuler](https://community.glideapps.com/u/Lin_Altshuler)\
**Post date:** [March 18, 2021, 8:52am UTC](https://community.glideapps.com/t/on-submit-action-rollback/24429/5 "2021-03-18T08:52:48Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [March 18, 2021, 8:55am UTC](https://community.glideapps.com/t/on-submit-action-rollback/24429/6 "2021-03-18T08:55:21Z")

</div>

You could actually take the approach that I described below ⬇ and apply it to this situation.

> [@All items in a form should have a Required check box](https://community.glideapps.com/t/all-items-in-a-form-should-have-a-required-check-box/24421/2):
>
> Firstly, I agree. All input components should have that option. That said, personally I would have little use for this as I rarely use the native form and instead choose to create my own forms from a details layout. Here is how I handle required fields: All input components will be writing to user specific columns For those inputs that are deemed as required, I will prefix the label with two asterisks (\*\*) to provide a visual clue In my table, I create an if-then-else column (ite-can-submit?)…
