How to update a table if another table were changed

Hi, i have 2 tables and i need that:

when table 1(visao) were changed/updated

table two (disponibilidade) add one row with some data

i’m trying to do this with actions and workflow but workflow get the action only for changes from current table, not apear my action from table (disponibilidade)

0 6 2,487
6 REPLIES 6

Based on your description, your action/workflow should trigger based on the change to Table 1.

There are a couple ways you could handle this:

  1. If changes are made to Table 1 by users, e.g. they changed data in a Form view, then you could add a custom Action to the Form Saved behavior. This Action type would be “add a new row to another table using values from this row”.

  2. Create a Workflow that triggers when a change is made to Table 1. The Workflow then executes the Action type described in 1) “add a new row to another table using values from this row”.

Hi, when I do this, it overwrites the info in all of the other columns. So, yes, it finds and edits the column I wanted it to but at the expense of overwriting all of the other columns that I don’t want it touching.

Are you sure the “Add a new rolw to another table using values from this row” can be used to change data? I’m experiencing that it overwrites all of the data i.e., when I use this to write data from Table 2 back into Table 1, the Table 1 data points that aren’t also in Table 2 get overwritten with blanks.

Change existing data, no. The original request was to add a row in Table 2 based on a change made to Table 1.

In your use case, it sounds like you wish to update a column in an existing row in a Table based on some change made in another Table. Unfortunately, there is not yet an action to make this happen even though it’s been asked for repeatedly.

There are ways to make this happen and have been outlined in previous posts. I’ll try to find one for you.

Well I’m not finding the post so here is the basic gist of what needs to be done to get the update you desire accomplished.

  1. Create an action on Table 1 (changed data) of type “execute an action on a set of rows”. I call this a bridge action because it bridges processing from Table 1 where the changed row is to Table 2 where the update is to be applied.
  2. Create an action on Table 2 (apply update) that selects the column and applies the update. Attach this action to the “Reference Action” property in 1).

If all you need to do make a simple update such as incrementing a count or setting a status, then the above is likely all you need.

However, many times you need to reference the changed value from the changed row and apply that as the update - e.g. updating Inventory amounts with a Quantity ordered.

This becomes a bit tricky because once you have transitioned from Table 1 to Table 2 using the action noted above in 1), you will no longer have a reference to the changed row. SO, you will need some way to identify the row just changed and select it using an expression in the action on Table 2.

There are a number of ways to identify the changed row but I like to be specific. I usually add an additional flag column to the Table 1 row used solely to identify the changed row. Then I can create an expression that looks for my changed row in Table 1 based on the set flag and use this expression in action from 2).

This also means that action 1 becomes a grouped action where action 1a sets the flag and action 1b is the “execute an action on a set of rows” and then an action 1c is required to clear the flag.

Hello! Could you show me a practical example of this operation?

Top Labels in this Space