Combining selected attribute values from 3 entities into a 4th entity. - Mendix Forum

Combining selected attribute values from 3 entities into a 4th entity.

0

Hello,  I'm wondering if anyone can help a newbie.  I have 3 entities with different attributes and I'd like to selectively copy those attribute values to a 4th (master) entity.  Copying the 1st entity to the Master is easy with a Create Object action in a loop.  Naturally, that doesn't work for the 2nd & 3rd entity because I want to map those attribute values to existing objects, not create new ones.  I tried Change Object & Change List actions, but I can't figure out how to map entity 2 or 3 attributes values to the master.  Both actions (Change Object & Change List) don't allow me to map entity 2 & 3 values to corresponding Master entity members.  Both actions seem to restrict the Input Variable, Member & Value to the same entity defined as the Loop Iterator.  I'm sure there's a way to do this.  Please advise.  Thanks.

 

asked
1 answers
1

Hi Mike,

Maybe I am over simplifying things, but this  how I understand your problem:

  1. Three tables
  2. These tables doesn't have associations with each other (parent - child, like car - car parts). Is that correct? (Although I think it's otherwise)?
  3. Different attributes of the three tables are copied in a new master table

 

If all 3 tables have the same amount of rows: Loop through Table 1 and:

  1. Create Table4 object en Table4 list
  2. Fill Attributes Table1 to Table4 object
  3. Add Table4 object to a list of Table4

Then Loop through Table 2 and

  1. Loop through List of Table4
  2. Fill Table4 object with Table2 attributes (change)

Then Loop through Table 3 and

  1. Loop through List of Table4
  2. Fill Table4 object with Table3 attributes (change)

 

When there are parent-child relations between the tables you create a loop within a loop withing a loop. Result will be a Table4 that looks like an "Excel sheet" which contains columns with duplicate data.

 

Hope that helps

 

answered