# Sequence of custom actions

**URL:** https://community.glideapps.com/t/sequence-of-custom-actions/35864
**Category:** Ask for Help
**Created:** [December 12, 2021, 6:23am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864 "2021-12-12T06:23:31Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![rayo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rayo/32/91372_2.png) [@rayo](https://community.glideapps.com/u/rayo)
#### Post date: [December 12, 2021, 6:23am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/1 "2021-12-12T06:23:31Z")

</div>

i have multiple set columns in a custom actions. But it seems that many times there are not performed in a sequence… especially when submitting a form? in a custom action flow, is the 2nd action performed after the first one is completed?

for example.  
set column 1: sets current date time stamp of a certain event.  
set column 2: takes this date/time stamp and puts it into another template.

but several times i find this date time stamp empty in the setcolumn2

---

<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: [December 12, 2021, 6:52am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/2 "2021-12-12T06:52:19Z")

</div>

As far as I’m aware, there is no guarantee that actions will be performed in sequence, so you cannot depend on or expect that to happen. (Actually, maybe a better way to put that is there is no guarantee that they will _finish_ in sequence). I’m not aware that it’s ever been explained how a multi-step action should be expected to behave, but my best guess based on experience and observation is that they _probably_ fire in sequence, but all actions are independent of each other. That is, each action triggers regardless of the status of any previous action.

I realise that your example is probably contrived, but if it isn’t - wouldn’t the 2nd set columns be redundant? ie. the template column could just read the value from the column that’s set in the first action.

Here is a visual that might better explain what I mean.

How we might expect it to work:

```auto
Action 1 ---------->| Action 2 ---->| Action 3 ------>|

```

How (I think) it actually works:

```auto
Action 1 ---------->|
 Action 2 ---->|
  Action 3 ------>|

```

---

<div class="post-metadata">

### Author: ![rayo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rayo/32/91372_2.png) [@rayo](https://community.glideapps.com/u/rayo)
#### Post date: [December 12, 2021, 7:25am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/3 "2021-12-12T07:25:12Z")

</div>

Thank you Darren as usual for the helpful advise and information.

Maybe I didn’t explain my example clearly. I have a log that tracks every action being done by users (staff members) of a delivery service. Lets say item A that is to be picked up from source the custom action would be:  
update item A status to picked.  
Update time of pickup and name of user that picked up.  
I have a template column thats puts all this information as “User X picked up Item A Time Y”  
Then I set a text column ‘LAST ACTION’ to the template column above “User X picked up Item A Time Y”

after that i want to add the last action to the history or log of actions regarding this item. So i have a temp template column that combines last action + old history of actions.

and i my last set column action is to update the text HISTORY COLUMN = the temp column (history + last action)

that way i keep a log of everything happening… but many times this doesn’t update correctly. especially when a form is submitting… it seems that the actions are performed before templates in the editor are updated etc.

---

<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: [December 12, 2021, 7:55am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/4 "2021-12-12T07:55:23Z")

</div>

I’m guessing that the reason your history column needs to be a (basic) text column is because you need the data in your Google sheet?

If that’s the case, I’m not sure that there is a good answer. In situations like this, I’ll often delegate some of the work to Integromat. That is, trigger a webhook with a payload containing whatever data is required, and then have Integromat do the data munging and update my Google Sheet in the background.

---

<div class="post-metadata">

### Author: ![rayo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rayo/32/91372_2.png) [@rayo](https://community.glideapps.com/u/rayo)
#### Post date: [December 12, 2021, 8:00am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/5 "2021-12-12T08:00:32Z")

</div>

I don’t really need the history in the google sheet. but since the items are in a google sheet, I had to add a column for the action history for each item.

if you consider it in strings. I want to create String A. Then Put String A + B in a temp String TEMP. Then put String TEMP back into String B (the history)

all in 1 custom action

---

<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: [December 12, 2021, 8:38am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/6 "2021-12-12T08:38:29Z")

</div>

yeah, I get it. I don’t think you can depend on that to work _all_ of the time, so what you are seeing is probably expected.

I just created a demo to mimic the scenario you described, and it _seems_ to work okay (even if I click really fast). But I don’t think I’d trust it…

Just to describe what’s going on there:

- Last Record Time is displaying the value of a user specific column
- History is a text column, which is basically a list of timestamps for each time the “Add Record” button is tapped
- Clear History clears the contents of the History column, and the User Specific Column
- There is a template column that takes the value of the user specific column, and adds that to the History column value.
- Each time the “Add Record” button is tapped, a custom action does two things:  
– Set Columns on the User Specific column to set it to the current date/time  
– Set Columns on the History column to set it to the value of the template

As I said, it seems to work, but…

---

<div class="post-metadata">

### Author: ![rayo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rayo/32/91372_2.png) [@rayo](https://community.glideapps.com/u/rayo)
#### Post date: [December 12, 2021, 8:43am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/7 "2021-12-12T08:43:43Z")

</div>

Yes its working fine like 99% of the time when the actions are triggered by a button. But for some weird reason, when the actions are triggered by a form successful submission things tend to get weird. I will try to record a video and share.

---

<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: [December 12, 2021, 10:47am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/8 "2021-12-12T10:47:08Z")

</div>

Is the form adding a new row, or editing an existing row?

If an add row, then my guess would be that because the add row takes longer, subsequent actions are kicking in before it’s finished.

But I’m just guessing, I don’t know any of this for a fact.

---

<div class="post-metadata">

### Author: ![rayo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rayo/32/91372_2.png) [@rayo](https://community.glideapps.com/u/rayo)
#### Post date: [February 15, 2022, 8:14am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/9 "2022-02-15T08:14:52Z")

</div>

this is still very very frustrating for me.

I am still facing the same issue.

I want to track user actions on the app. users are staff and actions for example can be such as : Driver A picked up Item at DateTime

i have 3 columns that track user actions  
column 1: LATEST Action Column  
column 2: HISTORY of actions done  
column 3: TEMP a template combining latest + history (used when a new latest is added so that i can copy this column back to history and update the actions history.

taking the driver example… when a driver picks an item he updates the edit item form triggering a set of custom actions:

- action 1: Current Date/Time saved, driver user profile name saved and action type saved in columns.

- In the background -there is a template column combining the above saved data into a sentence.

- action 2: takes the template column above and saves into the LATEST Action Column.  
\*\*\*ISSUE: sometimes before the template column is ready this action is performed ! hence it doesn’t get all the right data into the action.

- action 3: takes the TEMP column which is a merge of the latest action and history and puts it into the history column.  
\*\*\* ISSUE here also it seems the action starts performing before the template column is updated !!

seems like this issue is related with templates?? seems that templates take so much time in background that we cannot use a template updated in the first action in a next actoin.

---

<div class="post-metadata">

### Author: ![rayo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rayo/32/91372_2.png) [@rayo](https://community.glideapps.com/u/rayo)
#### Post date: [February 15, 2022, 8:24am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/10 "2022-02-15T08:24:23Z")

</div>

i guess its not the custom actions … there is a problem with using template columns in Glide in custom actions.

to simplify things.  
imagine this table

| text column 1 | text column 2 | template column 3 (1+2) | text column 4 |
| --- | --- | --- | --- |
| Hello | Name | Hello Name | - |

if we create a custom action that looks like this

action 1: set column1 to Good Bye  
action 2: set column 4 to column 3 value

we expect the result to be

| text column 1 | text column 2 | template column 3 (1+2) | text column 4 |
| --- | --- | --- | --- |
| Good Bye | Name | Good Bye Name | Good Bye Name |

but this doesn’t always happen !  
because between the actions, sometimes the template takes a longer time to execute

action 1: set column1 to Good Bye  
**here the column 3 template column does not execute in time**  
action 2: set column 4 to column 3 value

hence we end up with

| text column 1 | text column 2 | template column 3 (1+2) | text column 4 |
| --- | --- | --- | --- |
| Good Bye | Name | Good Bye Name | - |

---

<div class="post-metadata">

### Author: ![jabid](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jabid/32/33391_2.png) [@jabid](https://community.glideapps.com/u/jabid)
#### Post date: [February 15, 2022, 8:29am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/11 "2022-02-15T08:29:29Z")

</div>

Sorry, I don’t get something… Why do you need the column 4 since you have it in column 3?

---

<div class="post-metadata">

### Author: ![rayo](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/rayo/32/91372_2.png) [@rayo](https://community.glideapps.com/u/rayo)
#### Post date: [February 15, 2022, 8:44am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/12 "2022-02-15T08:44:01Z")

</div>

i need to save a history of actions happening…

column 4 is the Latest Action Done  
and only in the above custom actions example it is = value of column3.

but in other place in the app and other custom actions, i place other values into column 4.

---

<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 15, 2022, 8:59am UTC](https://community.glideapps.com/t/sequence-of-custom-actions/35864/13 "2022-02-15T08:59:15Z")

</div>

I see that you started [another thread](https://community.glideapps.com/t/issue-with-custom-actions-template-columns/38500), so I’ll respond there.
