Hello! I would like to think that if Glide offered the ability to reuse actions created before, targeting a specific table, can be used inside other actions targeting the same table.
For example:
-
I have 1 action that adds a row to table A.
-
I have another action that sets column values for a row in table A.
If I needed to use these two actions one after the other, I would currently need to create a third actions and manually replicate the action sequences and mapping from the first two.
Would it not be great if we could just reference the first two actions with their columns open to map, yet filled with a default value?
It would make actions really powerful!
Here’s a workaround. Inside the action editor (the button next to layout) duplicate the action you’d like to start from… if you need to change the source table you could do that as well.
2 Likes
Yes, that would be a smart workaround yet it would not be great in the long run, here’s why:
Let’s say I have an action, that can increment the inventory of an assembled product and decrement the inventory of its subcomponents. It maybe a long action with up to 5 or 7 related components, which means it would also consist of 5-7 action blocks, each incrementing the inventory of some component.
If I use the action duplication method and I ever want to make a change in the action mentioned above, I will have to ensure to make the change in all the actions that I have created from the duplication.
For a common action like inventory adjustment, you can imagine in how many components and across how many pages it might be used within.
If I could continuously repurpose the original action and edit the mappings for any of the mutations such as: add rows or set column values, it would be much more efficient. If I were to make a change in the original action, it would be changed whenever that original action was repurposed.
1 Like
Well you could reuse the same action in multiple parts of your app…(without duplicating it)
If I make an action “xyz” and then assign it to four different buttons… anytime I make a change to “xyz” it will change in all four spots.
Maybe I am missing the point 
Inside Make we could copy specific modules from one scenario to another… agreed that would be sporty 
1 Like
Ah yes, I do know you can reuse an action across several buttons and pages.
I am sorry, I am unable to explain the issue correctly.
Maybe I can try explaining it via a small code block:
//This function will return any number, squared to itself in the console
function Return_Any_Number_Squared(number){
var number_sqaured = number^number;
return number_sqaured;
}
//This is another function that will require to callback the previous number squaring function and then perform operations on that result
function numbers_squared_plus_number(number){
var squared_value = Return_Any_Number_Squared(10);
var squared_value_Plus_number = squared_value + number;
return squared_value;
}
Now, in the code block above, we have two functions. The first function allows the squaring of any number. Now in glide, let’s assume that this was the original action.
In the second function, we callback the first function and then we can re-map its variables, i.e → the number. We can then reuse the first function as the callack and then further manipulate that value.
Imagine that if I could create a new action in glide (like the second function) and then be able to reference the first action (function 1), be able to map the values to run through the first action and then be able to map the first actions result, through the rest of the action blocks.
The easiest way to understand this is to treat the actions in Glide as functions in a script editor.