Simple - Action to change column +1

Hi,

How would I create an action where a column will add 1 each time the action is ran?

I have a child record that when updated, I'm planning on adding this action to my already sequence of actions, which should edit/save the entire parent record (and thus calculate columns in the parent table that depend on columns from the child table), as well as, tell me the # of times the parent record is updated (kinda two birds with one stone thing)

 

Child Table:  Time

Parent Table:  Jobs

Parent Table Column that needs to be +1'ed (number type):  Number of Updates

 

Will this work the way I think?  Thanks in advance!

0 5 133
5 REPLIES 5

Interesting.  Didn't know that was an option.  Guess I'm a little confused on how that would work.  If I have the tracking column in the parent table, how can I make it track changes in the child column?  And will that edit/save the whole table to perform the other column calcs?

Basically, when a row is added to the Time table, I need it to update the Total Time column in the Jobs table, without having to open, edit, and save the Jobs record


@Joe_Seiler wrote:

Guess I'm a little confused on how that would work.


If you're referencing the Change column types described in the article I linked to, it's certainly possible that that wouldn't serve your use case.


@Joe_Seiler wrote:

If I have the tracking column in the parent table, how can I make it track changes in the child column?


I understood from your original post that you have a "sequence of actions, which should edit/save the entire parent record", in which case whichever of those actions that is already updating a parent row could be used to trigger incrementing a Change type column. If you're not making any changes to the parent row, then a Change type column indeed would not meet your need.


@Joe_Seiler wrote:

And will that edit/save the whole table to perform the other column calcs?


Any update to a row will trigger recalculation of:

  • All data source columns in that row, including Change type columns
  • Virtual columns throughout the app that reference the updated row

@Joe_Seiler wrote:

Basically, when a row is added to the Time table, I need it to update the Total Time column in the Jobs table, without having to open, edit, and save the Jobs record


Consider a virtual column, e.g.:

SUM([Related Time Rows][Time])


@Joe_Seiler wrote:

Basically, when a row is added to the Time table, I need it to update the Total Time column in the Jobs table, without having to open, edit, and save the Jobs record


In addition to the suggestion of @dbaum  of using a VC to sum the time in the parent table, just in case you wish to use a real column, you can do so using reference actions.

The sample app below updates the child table rows' real columns based on the action invoked in the parent table. You can reverse the flow- meaning you can update the parent table real columns based on changes in the child table.

Reference Actions - AppSheet

 

Thanks all for your input.

So I basically ended up going this route:

Created an action to cause a counter in the parent table to do + 1 on action (which is nice since itโ€™s also a counter to tell me how many times the related record on the child table has been updated)

Created an action in the child table to fire the parent table action

Created a bot to monitor the child table for all changes, which then fires the child table actionโ€ฆwhich then fires the parent table action

Do you think this will work, or will there be issues?

 

Top Labels in this Space