# Only first condition in actions is working

**URL:** <https://community.glideapps.com/t/only-first-condition-in-actions-is-working/42142>\
**Category:** Ask for Help\
**Created:** [May 19, 2022, 6:30am UTC](https://community.glideapps.com/t/only-first-condition-in-actions-is-working/42142 "2022-05-19T06:30:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Siebe\_Gorter1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/siebe_gorter1/32/55133_2.png) [@Siebe\_Gorter1](https://community.glideapps.com/u/Siebe_Gorter1)\
**Post date:** [May 19, 2022, 6:30am UTC](https://community.glideapps.com/t/only-first-condition-in-actions-is-working/42142/1 "2022-05-19T06:30:26Z")

</div>

Hi Guys,  
I have made a custom form with a save button. In the action i have given multiple conditions, but it’s only responding on the first condition. Is this a known problem? Or am i doing something wrong?

 ![Skærmbillede 2022-05-19 kl. 08.24.53](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/3/4/34e0dabf6fa8fd14d8183fa101757ba33b1a9be6.jpeg)

---

<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:** [May 19, 2022, 6:39am UTC](https://community.glideapps.com/t/only-first-condition-in-actions-is-working/42142/2 "2022-05-19T06:39:45Z")

</div>

It’s most likely an error or misunderstanding in the way you’re applying your logic.

The way a custom action with multiple conditions works is that it will execute the first branch where the IF condition returns true, and then short-circuit (ie. none of the other branches will execute).

So if you’re finding that it only ever executes the first branch, that probably means that the first condition _always_ returns true.

One piece of advice: I notice that you have a fairly complex if-then-else condition in the first branch, with several tests. What I usually do in cases like this is move the logic to the Glide Data Editor. So instead of complex if-then-else logic in the action, create an if-then-else column in the data editor that returns true or false/empty. Then your action condition can just be something like “if blah-blah is not true, then…”  
Taking this approach makes it a lot easier to debug when things don’t work as you expect.

---

<div class="post-metadata">

**Author:** ![Siebe\_Gorter1](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/siebe_gorter1/32/55133_2.png) [@Siebe\_Gorter1](https://community.glideapps.com/u/Siebe_Gorter1)\
**Post date:** [May 19, 2022, 6:44am UTC](https://community.glideapps.com/t/only-first-condition-in-actions-is-working/42142/3 "2022-05-19T06:44:16Z")

</div>

Hi Darrren,  
It’s only executing the first condition on every branch

thanks for advice, i’ll try to move the conditions to data editor

---

<div class="post-metadata">

**Author:** ![David\_Gabler](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/david_gabler/32/44332_2.png) [@David\_Gabler](https://community.glideapps.com/u/David_Gabler)\
**Post date:** [May 19, 2022, 1:51pm UTC](https://community.glideapps.com/t/only-first-condition-in-actions-is-working/42142/4 "2022-05-19T13:51:55Z")

</div>

> [@Darren\_Murphy](#):
>
> move the logic to the Glide Data Editor

I do this also. One of the main reasons is that the if/else logic in the data editor and the if/else logic in the custom actions were developed independently of each other, and so they both work differently. So for consistency, I always use the logic in the data editor when I can.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [May 20, 2022, 1:52pm UTC](https://community.glideapps.com/t/only-first-condition-in-actions-is-working/42142/5 "2022-05-20T13:52:43Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
