Create new rows in the other table using data from multi tables

ism
Bronze 5
Bronze 5

I am wondering how to create new rows into the other table using data from multi tables.

What I mean is that I have one child table with two tables as parents.
I want to create new Rows from this child table in a third table.
In the new Rows, I also want to include information taken from the parent tables.

Is there a good way to do this?

Solved Solved
0 5 115
1 ACCEPTED SOLUTION

 

Parent 1 Table Structure

Parent1IDFieldAnotherFieldYetAnotherFieldetc...
UniqueID()    
UniqueID()    

Parent 2 Table Structure

Parent2DFieldAnotherFieldYetAnotherFieldetc
UniqueID()    
UniqueID()    

Child Structure

ChildIDParent1IDLinkParent2IDLinkChildfieldChildField2etc
UniqueID()Parent1RefParent2Ref   
UniqueID()     

Combination Table Structure

CombiIDChildFieldAnotherFieldYetAnotherFieldParent1DataParent1Data2Parent2DataParent2Data2etc
UniqueID()        
UniqueID()        

Create a Behaviour on Child Structure Table

  • Behaviour Name = CreateCombiRecord,
  • Behaviour Type = 'Add row to another table using values from this row',
  • Table to Add to = 'Combination Table Structure'

Fields to Modify

  • [ChildField] = [ChildID]
  • [AnotherField] = "Whatever..."
  • [YetAnotherField] = "Read Docs..."
  • [Parent1Data] = [Parent1Ref].[Field]
  • [Parent1Data2] = [Parent1Ref].[YetAnotherField]
  • [Parent2Data] = [Parent2Ref].[AnotherField]
  • [Parent2Data2] = [Parent2Ref].[etc]
  • [etc] = "Hope this is making sense..."

[Parent1Ref].[YetAnotherField] is a Dereference Expression...Check it out HERE

View solution in original post

5 REPLIES 5

 

Parent 1 Table Structure

Parent1IDFieldAnotherFieldYetAnotherFieldetc...
UniqueID()    
UniqueID()    

Parent 2 Table Structure

Parent2DFieldAnotherFieldYetAnotherFieldetc
UniqueID()    
UniqueID()    

Child Structure

ChildIDParent1IDLinkParent2IDLinkChildfieldChildField2etc
UniqueID()Parent1RefParent2Ref   
UniqueID()     

Combination Table Structure

CombiIDChildFieldAnotherFieldYetAnotherFieldParent1DataParent1Data2Parent2DataParent2Data2etc
UniqueID()        
UniqueID()        

Create a Behaviour on Child Structure Table

  • Behaviour Name = CreateCombiRecord,
  • Behaviour Type = 'Add row to another table using values from this row',
  • Table to Add to = 'Combination Table Structure'

Fields to Modify

  • [ChildField] = [ChildID]
  • [AnotherField] = "Whatever..."
  • [YetAnotherField] = "Read Docs..."
  • [Parent1Data] = [Parent1Ref].[Field]
  • [Parent1Data2] = [Parent1Ref].[YetAnotherField]
  • [Parent2Data] = [Parent2Ref].[AnotherField]
  • [Parent2Data2] = [Parent2Ref].[etc]
  • [etc] = "Hope this is making sense..."

[Parent1Ref].[YetAnotherField] is a Dereference Expression...Check it out HERE

ism
Bronze 5
Bronze 5

@scott192 

Thank you very much for detailed guidance!ใ€€Let me ask one more question.

How should I set the data TYPE for  the table "Combination Table Structure"?

I guess the colums other than "CombiID" shoulde be Ref TYPE ?

Am I right??

Is 

Hi!,

No...the columns for your combi table do not have to be Refs as they are being set with the ACTUAL data that is being pulled in from the Dereferenced expression.  If you set them as Refs to your Parent1 and Parent2 tables then you will not need to use a Dereferenced expression within your Action.

What the Action I gave you currently does is to LOOKUP the values in Parent1/Parent2 and write those values directly into your Combi table.  This will be whatever those values were AT THE TIME that the Action was triggered.  If subsequently you changed those values in your Parent1/Parent2 table, your Combi table values WILL NOT CHANGE.

If you wish those Combi values to update as the Parent1/Parent2 records change, then you should just develop your Combi table in the same way that you made your Child table.

If you did not really get a handle on the Dereferencing Expressions I linked to and felt they were not for you then I would urge you to reconsider.  They are FUNDAMENTAL to how each of your data tables can talk to each other.

@scott192 

Thanks for your message!

Now I think I understood!

ism
Bronze 5
Bronze 5

ism_0-1664517141862.png

The app like this.

And I would like to go to Parent table form the Combination View?

Top Labels in this Space