# I need help: a custom action is not working correctly

**URL:** https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367
**Category:** Ask for Help
**Created:** [February 7, 2021, 12:03pm UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367 "2021-02-07T12:03:58Z")
**Posts on this page:** 15
**Page:** 2

<div class="post-metadata">

### Author: ![Fabio\_Leanzi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/fabio_leanzi/32/6838_2.png) [@Fabio\_Leanzi](https://community.glideapps.com/u/Fabio_Leanzi)
#### Post date: [February 8, 2021, 7:20pm UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/21 "2021-02-08T19:20:23Z")

</div>

Example  
Action1: Set column  
Action2: Add row  
Action3: Set column \<---- This set column don’t work

This is the action

 ![Schermata 2021-02-08 alle 20.29.46](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/0/d/0d93fc6d48cf431844c1afffbb99af0a7d1572c0.png)  
This action work  
 ![Schermata 2021-02-08 alle 20.29.29](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/f/9/f99ffec49dde910e446073b7edd1a53f8bd474a2.png)  
This action don’t work  
 ![Schermata 2021-02-08 alle 20.29.40](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/4/f/4fa7081cc6c1cc2d4d4d9d9149714f1f61316d9f.png)

---

<div class="post-metadata">

### Author: ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)
#### Post date: [February 8, 2021, 7:42pm UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/22 "2021-02-08T19:42:44Z")

</div>

And this is why I use scripts at zero cost and zero frustrations.

---

<div class="post-metadata">

### Author: ![Fabio\_Leanzi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/fabio_leanzi/32/6838_2.png) [@Fabio\_Leanzi](https://community.glideapps.com/u/Fabio_Leanzi)
#### Post date: [February 8, 2021, 7:45pm UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/23 "2021-02-08T19:45:15Z")

</div>

Could you tell me more?

---

<div class="post-metadata">

### Author: ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)
#### Post date: [February 8, 2021, 8:01pm UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/24 "2021-02-08T20:01:36Z")

</div>

Well I made a script that allows for texts or emails to be sent at no cost to you. It is triggered by changes in the sheet and doesn’t require you to add it to your buttons. Here’s the link.

> [@Free push notifications Workaround](https://community.glideapps.com/t/free-push-notifications-solved/6183):
>
> I have a solution for PUSH NOTIFICATIONS. It works with IOS and ANDROID. It is quick and has ZERO cost to everyone. You can do this in your google sheet or a separate sheet that is linked to your original (I used 4 linked sheets, I’ll explain later). 1st you setup on your sheet a variable or value you are wanting to trigger the notification. This data will need a VLOOKUP formula to link to the person you want notified’s phone number and phone carrier, so when the vlaue on the sheet is found usin…

---

<div class="post-metadata">

### Author: ![gvalero](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/gvalero/32/1037_2.png) [@gvalero](https://community.glideapps.com/u/gvalero)
#### Post date: [February 8, 2021, 8:27pm UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/25 "2021-02-08T20:27:55Z")

</div>

Ah!!

Your _Variable Column_ is set to 1 as flag to indicate the process is running, later you call a Webhook and finally, you reset the flag (0) to notify customer that everything is done… right?

The problem here is that Glide doesn’t wait for Zapier (there is no pause) and your Column has 2 values so fast that technically you will see the last value (0) always …

Although the Actions work as a sequence, each step is executed without waiting the previous one. To sum up, there is no a kind of pause or delay between 2 steps.

What about if you force that “completion flag” creating a new step in Zapier? Try making a completion flag in Zapier writing a 0 (or any value) into a cell in your GS. If that cell is different to empty then, the action was completed!

I hope it helps you.

Saludos

---

<div class="post-metadata">

### Author: ![Fabio\_Leanzi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/fabio_leanzi/32/6838_2.png) [@Fabio\_Leanzi](https://community.glideapps.com/u/Fabio_Leanzi)
#### Post date: [February 8, 2021, 10:44pm UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/26 "2021-02-08T22:44:26Z")

</div>

> [@gvalero](#):
>
> st that technically you will see the last value (0) always …
> 
> Although the Actions work as a sequence, each step is executed without waiting the previous one. To sum up, there is no a kind of pause or delay between 2 steps.
> 
> What about if you force that “completion flag” creating a new step in Zapier? Try making a completion flag in Zapier writing a 0 (or any value) into a cell in your GS. If that cell is different to empty then, the action was completed!
> 
> I hope it helps you.
> 
> Saludos

My problem is that the value stays at 1 instead of returning to 0  
I do not need to wait for the zap to complete, but simply to lock the button so that it does not press more than once, then by setting the variable to 1 the key disappears … by setting the variable to 0 the key reappears … the problem is that the variable stays at 1  
I can try to change the value via a new zap … but it really gets too long

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [February 8, 2021, 11:11pm UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/27 "2021-02-08T23:11:32Z")

</div>

So in that brief moment that the button disappears and reappears (assuming it worked), are you allowing the user to submit again? I am aware that you are trying to address the issue of multiple submissions, but I wonder how effective that split second hide and reappear of the button would prevent multiple submissions. I know @Darren_Murphy has speculated that sometimes actions may run all at once and possibly run out of order. I wonder if that’s the case here, where it may be setting the value to 0, but it does it BEFORE it sets the value to 1, so you end up with a final value of 1.

I would probably rethink the logic a little bit. What I would maybe consider doing…instead of setting the column value to 1…set it to the current date/time. Then in the sheet add a math column to add 5 seconds to that date/time. Then set a visibility condition on the button to only show if the math column is before Now. Then you shouldn’t need a second Set Column action. If it all works, hopefully the user will click on the button, it will set the current date/time and the math column will calculate the date/time to be greater that Now for 5 seconds, which will hide the button. After 5 seconds, the button should come back.

---

<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: [February 9, 2021, 1:31am UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/28 "2021-02-09T01:31:32Z")

</div>

> [@Jeff\_Hager](#):
>
> I know @Darren_Murphy has speculated that sometimes actions may run all at once and possibly run out of order.

I’ve seen enough evidence now to be fairly convinced this is true.

> [@Jeff\_Hager](#):
>
> What I would maybe consider doing…instead of setting the column value to 1…set it to the current date/time. Then in the sheet add a math column to add 5 seconds to that date/time. Then set a visibility condition on the button to only show if the math column is before Now.

hmm, I wonder if that technique might help with my “[return to top of the screen](https://community.glideapps.com/t/send-user-to-top-of-screen-with-action/19483)” challenge (which I never found a satisfactory solution for). I’m skeptical, but I’ll give it a try…

---

<div class="post-metadata">

### Author: ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)
#### Post date: [February 9, 2021, 1:35am UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/29 "2021-02-09T01:35:42Z")

</div>

Hmm, possibly, but I wonder if you’d still run into that 5 or 10 second delay for dates to update in the glide data. Might be fine to temporarily hide a button, but might be too slow for your return to top situation.

---

<div class="post-metadata">

### Author: ![Fabio\_Leanzi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/fabio_leanzi/32/6838_2.png) [@Fabio\_Leanzi](https://community.glideapps.com/u/Fabio_Leanzi)
#### Post date: [February 9, 2021, 8:49am UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/30 "2021-02-09T08:49:43Z")

</div>

Very interesting … I try 🙂

---

<div class="post-metadata">

### Author: ![Fabio\_Leanzi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/fabio_leanzi/32/6838_2.png) [@Fabio\_Leanzi](https://community.glideapps.com/u/Fabio_Leanzi)
#### Post date: [February 9, 2021, 9:48am UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/31 "2021-02-09T09:48:37Z")

</div>

It works … thanks for the help 😃 😃 😃 😃

---

<div class="post-metadata">

### Author: ![Fabio\_Leanzi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/fabio_leanzi/32/6838_2.png) [@Fabio\_Leanzi](https://community.glideapps.com/u/Fabio_Leanzi)
#### Post date: [February 9, 2021, 4:47pm UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/32 "2021-02-09T16:47:40Z")

</div>

Damn, I thought I solved the problem… unfortunately I keep getting double calls to the webhook 😔 😔 😔 😔

---

<div class="post-metadata">

### Author: ![Drearystate](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/drearystate/32/49605_2.png) [@Drearystate](https://community.glideapps.com/u/Drearystate)
#### Post date: [February 9, 2021, 5:01pm UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/33 "2021-02-09T17:01:28Z")

</div>

I know that column set values and add rows will run in the order you set them in relation to one another. Aside from those 2 actions I do not know.

---

<div class="post-metadata">

### Author: ![Fabio\_Leanzi](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/fabio_leanzi/32/6838_2.png) [@Fabio\_Leanzi](https://community.glideapps.com/u/Fabio_Leanzi)
#### Post date: [February 10, 2021, 9:19am UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/34 "2021-02-10T09:19:26Z")

</div>

I solved the problem by creating my own custom API to send mail. If the id that comes to me has already been processed, then I skip the operation.

---

<div class="post-metadata">

### Author: ![NoCodeAndy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/nocodeandy/32/62530_2.png) [@NoCodeAndy](https://community.glideapps.com/u/NoCodeAndy)
#### Post date: [January 17, 2024, 4:53pm UTC](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367/35 "2024-01-17T16:53:26Z")

</div>



[Previous page](https://community.glideapps.com/t/i-need-help-a-custom-action-is-not-working-correctly/22367.md?page=1)
