Easily transfer child records to a new parent

Hi all,

I have the following hierarchy in my data tables: Commitment > Mission > Practice > Reflections.
I have a scenario where I want to change a mission from one commitment to a different commitment.
I then want to be able to run a workflow to gather all the grand-child and great-grand child records and automatically update them to the new commitment ID.

In order to do this in appsheet, I imagine I need to run a select list of all child records

  • practices with the commitment ID before value

  • reflections with the commitment ID before value

And then update them with the Commitment ID after value

Is this the most efficient way to make this change app side?
I could really use help coming up with the actions, workflow and expression to execute this.

Solved Solved
0 6 558
1 ACCEPTED SOLUTION

Steve
Platinum 4
Platinum 4

UNTESTED!!!

(Action 1)

  • For a record of this table: Reflections
  • Do this: Data: set the values of some columns of this row
  • Set these columns:
    • Commitment ID: [Practice ID].[Commitment ID]
  • Only if this condition is true:
    OR(
      ISBLANK([Commitment ID]),
      NOT([Commitment ID] = [Practice ID].[Commitment ID])
    )
    

(Action 2)

  • For a record of this table: Practice
  • Do this: Data: set the values of some columns of this row
  • Set these columns:
    • Commitment ID: [Mission ID].[Commitment ID]
  • Only if this condition is true:
    OR(
      ISBLANK([Commitment ID]),
      NOT([Commitment ID] = [Mission ID].[Commitment ID])
    )
    

(Action 3)

  • For a record of this table: Practice
  • Do this: Data: execute an action on a set of rows
  • Referenced Table: Reflections
  • Referenced Rows:
    FILTER(
      "Reflections",
      ([Practice ID] = [_THISROW])
    )`
    
  • Referenced Action: (Action 1)

(Action 4)

  • For a record of this table: Practice
  • Do this: Grouped: execute a sequence of actions
  • Actions:
    • (Action 2)
    • (Action 3)

(Action 5)

  • For a record of this table: Mission
  • Do this: Data: execute an action on a set of rows
  • Referenced Table: Practice
  • Referenced Rows:
    FILTER(
      "Practice",
      ([Mission ID] = [_THISROW])
    )`
    
  • Referenced Action: (Action 4)

View solution in original post

6 REPLIES 6
Top Labels in this Space