I have a Parent and Child table in my app. One column in the parent table is computed by summing a specific column of its child rows. To achieve this, I created a reference action in the child table that is triggered when the Child table form is saved. This action, in turn, calls an action in the parent table to update the relevant column. This works well. However, an issue arises when a child row changes its parent. In this case, only the new parent's column gets updated, but both the old and new parent's columns should be updated since the sum for the old parent is also affected. To address this, I saved the old [parentID] value of the child row in a separate column [oldParentID] in the child table. I set the initial property value of this column to [_THISROW_BEFORE].[parentID] and reset to the initial value on edit property to [_THISROW_BEFORE].[parentID] <> [parentID]. This is making [oldParentID] accurately reflect the previous value of [parentID] in the Google Sheet. I then updated the form saved event action to include both [parentID] and [oldParentID] in its reference list using List([parentID], [oldParentID]). This should trigger the parent action for both the current and the previous parent. Despite this, the old parent's column is still not updating.
What am I missing?
@Suvrutt_Gurjar
@AleksiAlkio
Solved! Go to Solution.
Changing [oldParentId] from type text to type ref fixed the issue. This seems to be a bug in AppSheet because it creates unnecessary double reference to the parent in the child and redundant lists of related childs in the parent, leading to unnecessary computational overhead for AppSheet to maintain these references and lists.
@Joseph_Seddik @Suvrutt_Gurjar @AleksiAlkio @Steve @Marc_Dillon @dbaum
User | Count |
---|---|
34 | |
11 | |
3 | |
3 | |
2 |