Run an action from another action

How to run an action from another action.
In the summer there was such an option, but now I can’t find it.
Maybe it can be implemented somehow else?

Actions cannot call other actions. This has never been a thing.

Or do you mean chained actions?

1 Like

My memory must be failing me.
But now I have the task of running the action several times until I am satisfied with the result of its action.
For example, delete 1 line until the number of lines is equal to the required number.
Or generate a random value, but if it coincides with the previous result, then repeat the action again, or several times. Although an infinite loop is possible here.

Are they real examples, or ones that you just made up?

If they are real, I could think of a way that each of them could be dealt with by a single action.

These are real challenges. With the generator I’ll probably figure out how to get out of it, but with the deletion/addition of strings to make them a given number, I can’t think of anything yet.

You appear to have moved the goal posts :slight_smile:

Earlier you said:

But now that has morphed into:

so before I attempt to offer a solution, would you mind clarifying please? (a screenshot might help)

Well, it’s our job to move the goalposts, especially if the ball doesn’t go where it’s supposed to go.
The picture shows how the user after changing the accounting slot interval can bring the auxiliary table to the optimal size.
In one click he adds a missing row or removes an extra row.
It can be 10 clicks, or it can be 100.

Summary

2023-09-20_20-10-21
2023-09-20_20-10-51

Okay, that makes it clearer, thanks.

So here here is a suggestion - instead of adding/removing rows, why not keep the number of rows static, and use an if-then-else column to validate them?

Taking your example:

  • You know that valid time slots must match the Work Time, which is 9:00AM to 5:00PM
  • Add your Start and End times to your Auxiliary table as Single Value columns.
  • Add an if-then-else column:
    – If Time is before Start Time, then null (leave empty)
    – If Time is after End Time, then null
    – Else Time

This will give you a column with a list of valid time slots.

This is exactly how it worked as long as the number of rows was small.
But when the interval becomes 5 minutes instead of 1 hour, the number of lines per day will be 288.
Considering that the line limit per application is 500, we have to think about optimization.
After optimization, 96 lines will suffice

@Darren_Murphy Don’t agonize in vain.
If can’t do a loop, I will reduce the number of clicks by creating multiple actions for 1, 2, 4, 8, 16, 32, 64 string actions.
To change the number of rows to 127 would require a maximum of 7 clicks with 7 actions.

With the addition of a few lines of action works.
But deleting multiple rows doesn’t work, it always deletes 1. How to switch to another line after deleting the current one? “Shuffle order” and “Set column value” between deletions do not solve the problem.

The deletion problem has been solved.
I made Relation with extra lines and delete referring to it.

It’s definitely a must have functionality that Glide should have.
I’m forced to use tons of zaps from Zapier to simply start really simple actions.
For instance in my case : sent action logs to my Discord server when a new row is added to the Logs table (it will consume a lot of Glide updates, I know :slight_smile:)

What’s stopping you from doing that now using an onSubmit action with the Discord integration?

You’re right it would be perfect because it’s exactly what it meant for and my current need.

But from my knowledge the “On Submit” functionality is only available when creating a row from an “Add” screen but I need to use it from an action (but maybe I’m wrong?).

So as Glide can’t do it, I’m not logging from a Glide action the log to my Logs table, I’m passing the User Row ID and the “action” into Zapier which will add the row to the Glide Logs table and then send the Discord message to my log channel.

Do you have a better idea on how to handle this? Thanks!

That is correct, yes.

But actions can be chained. If you’re not using an Add Form, then does that mean that you are using some sort of Custom Form with an Add Row action when a button is clicked? There should be no reason why you can’t add an extra node in the action sequence that sends the new data to your Discord server.

Maybe I’m misunderstanding your use case. If that’s the case, you may need to elaborate more to help me understand.

Exactly and you’re right I can add an extra Discord right after the “Add row” action, it’s working great.

The root cause of my problem is because I placed my button in a screen (“Aide”/“Help”) which doesn’t have the “Logs” table as datasource. So when I want to select the comment I just added into the Logs table into the Message properties (from the Discord action), I can’t access it because it’s not the same datasource table.

I may be wrong on the way I’m doing this, I’ll try to do the same with a screen based on the Logs datasource instead.

But regarding the original topic, if Glide could run action from action, I would just have to run the action “send latest log to discord” (where the action gets the latest log and send it if not already sent). That would be… more convient I guess :smiley:

When you add a new row, log that row’s ID somewhere in your user profiles table, and then retrieve the last message using a relation + rollup. Then use that in your Discord node.

1 Like

Yes you’re right but with a little modification (my Users table has so many columns because data inside follows the user everywhere, feel like a cheat code :laughing:) :

  1. Added the User Row ID into the Logs new row (with “Discord Message” & other properties),
  2. Created a “Relation/User → Logs” with “Match multiple” checked (spoiler: otherwise “Single Value (Last)” won’t work)
  3. New “Single Value” column into Users : “Logs/Last Action Log Message” with Configuration Get : Last & From : Relations/User → Logs → Discord Message

Finally, action from action are not needed indeed :smiley:
Thanks for your help @Darren_Murphy @ThinhDinh

2 Likes

Yep, that looks like the correct way to do it!