Create two actions in a button

Is it currently possible to create two actions that act on two different tables at the same time?
For example, I like to create a start and end button. When hitting the start button, it marks the starting time. When I hit the end button, it will log the duration that I worked into this corresponding task but create a separate log in another table. Currently, I don’t know if this is possible.

3 Likes

Hi,

As explained in the documentation how to work with buttons, just create a button for each action you want to be executed and then use a “push button” button to execute multiple actions with one push.

As I have not yet personal experience with this functionally, this is the only advice I can give.

Enjoy Coda and would be glad to understand if you managed to get the magic working.

Kind regards,
//JP

1 Like

I would love to stack actions to only one button.
Automation for this would be awesome.
Like a trigger for automation would be Push button. @preeyanka what do you think of this?

1 Like

I got a workaround. I created a new variable recording how many times this button is pressed by setting the variable = variable+1. Then I use the change of this variable to trigger the automation for all other tasks, such as modifying something in another table. Currently it works great. You can hide this variable since it is not useful except for the trigger.

1 Like

Another way of doing it would be to put the actions like AddRow(table, column, columnValue) or ModifyRows(rows, column, columnValue) into a List(value) when enabling the formula editor on a button.

For example:
List(ModifyRows(thisRow, Status, "Done"), AddRow(thisTable, Status, "Added"))

Not sure if this is best practice but I let someone more experienced comment on it.

5 Likes

@Nenad_Ilic, I like this for when creating individual buttons by themselves, is inconvenient or unusable as individual elements.

And now discovered the more explicit:

RunActions(<formula1>, ...)

Which is in the formula docs and mentioned in other threads like:

4 Likes