Bug or Not? A data change action inside a grouped action not producing expected results

Hello All,

You know how when you update a column with a data change action it makes AppSheet recalculate all app formulas in other columns of the affected row?

Well, I have a grouped action sequence that creates child records for a parent record with looped actions and then the last action in the group updates a column on the parent record so that it would trigger re-calculation of all columns with app formulas so that they now show new data based on the newly created child records. When I run the grouped sequence, I get the child records created and the column updated on the parent record but none of the columns with app formulas get re-calculated.

auto-update.gif


BUT, if I take out that data change action for the parent record from the grouped action sequence and then manually activate it right after triggering the grouped sequence for the loop of child records, everything works as expected.

manual-update.gif

 

Is there something I'm missing or is this a bug?

Solved Solved
0 11 549
1 ACCEPTED SOLUTION

It may depend on where are the AppFormulas

VC, real columns?

After that, I have to say that I have had problems like this in the past and I had to add a column and another action (simple one that changes the column) to make sure the whole row gets updated

View solution in original post

11 REPLIES 11

It may depend on where are the AppFormulas

VC, real columns?

After that, I have to say that I have had problems like this in the past and I had to add a column and another action (simple one that changes the column) to make sure the whole row gets updated

Real columns with app formulas.

So maybe I just need something to add extra time to the processing of the actions? Like an extra column to be updated on the parent record so that the system has time to see the newly created child records and correctly calculate the parent record columns with app formulas.

Real columns get updated when the row is edited.
VC are updated kinda real time.

So adding another column would help (Mine is the simplest. It's a number column and the action is [Column]+1)

Are those expressions in the real columns using a REF_ROWS VC though? That could be your issue, the REF_ROWS VC might not update until the sync is complete, which would be after your final Action. If so, assuming your expressions are like SELECT( [Related...] ... ), the solution would be to change them to SELECT( base-table[..] , [ref]=[_THISROW] ).

Yes, my expressions are using REF_ROWS VC. I already tried adding an extra data change action to the sequence and that makes the parent table columns update correctly.

I will now try your suggestion and change the expressions to not point to the REF_ROWS VC and instead look up the table directly and I'll report back.

@Marc_Dillon 

I tried changing the expressions from VC references to SELECT and still the parent table would not update correctly unless I used @SkrOYC suggestion of adding an additional data change action to the sequence.

It seems the system needs a bit of extra time to see the child records that were added during the action.

For anyone looking at the answer. Further testing presented the following results: Using a data change action to just place a new values on a column did not trigger the parent record columns to be re-calculated during the grouped action sequence, it didn't matter if I added a second data change action as long as it was just placing a new value on the column.

What did work was using the data change action to take the current value of the column and change it with an operation like adding or substracting from the value in the column. That worked every time even with just one data action in the sequence.


Using a data change action to just place a new values on a column did not trigger the parent record columns to be re-calculate

...

What did work was using the data change action to take the current value of the column and change it


Not sure what you mean by "new value".

But yes, you definitely have to change the value for this to work. If you try to set the column value to the existing value, the system will recognize that there is no change, and not cause any sync, including not re-calculating any other columns.

By "new value" I mean changing the column value to a different one but not using the old one to calculate it. For example:

I use a DATETIME column and the data action had a NOW() expression. That action did not trigger the recalculation of the columns.

But if I use an expression like [Column] + "001:00:00", that works like it should.

Take into account that if you are using a NOW() expression on a loop, the loop will run at a faster rate than 1 record per second, that's the minimum change. I mean, NOW() will enter a different result every second but the loop is creating new ones faster than that so you need another expression to make sure the row is updated. That's why the [Column]+1 works better in this case

Yep, that is what's going on. Each loop finishes too fast and there are not that many so that it would take more than a second from the first one to the last one. So NOW() at the start is the same as the last NOW() calculated.

Top Labels in this Space