Merge two list

0
Do we have any list operation in mendix by which we can merge two lists. For example , we need something as shown in below image : 
asked
4 answers
2

Hello Shriram,

 

You can use the List Operation activity found in microflows and choose the Union operation

Like this..

 

answered
0

Hi Shriram,

 

Union list operation should work with your requirement.

check below link for your reference-

List Operation | Mendix Documentation

 

Hope it helps

answered
0

Hi Shriram,

You can use the Union List operation for merging the two lists

answered
0

What you try to do it adding Apples to Pears, which isn't possible in Mendix.

 

Not sure where your list originates, but my gut feeling tells me you have it outside Mendix in a excel or alike. Right?

In that case import both list separately (using the excel importer or alike)

Where you do have 2 options

Option 1

  1. Import Apples to an Apple entity, containing Apple attributes
  2. Import Pears to an Pear entity, containing Pear attributes
  3. Create a Fruit entity, containing Apple and Pear attributes
  4. Merges the Apple and Pear values in a Fruit object. Use the key to match.
  5. If you don't need the Apple and Pear objects anymore: delete them

Option 2

  1. Create a Fruit entity, containing Apple and Pear  attributes
  2. Import Apple to the Apple attributes in the Fruit object
  3. Import Pear to the Pear attributes in the Fruit object
  4. Use the Key value for syncing

Option 1 give opportunity to have Apples, Pears and Fruit

Option 2 leaves you with only Fruit. Pick whatever suits you

 

Annnnd there is a 3rd option

  1. Import apples to an Apple entity, containing Apple attributes
  2. Import pears to an pear entity, containing pear attributes
  3. Add a 1-1 association between Apple and Pear
  4. Set the association between Apple and Pear. Use the key to match.
  5. If you want to show the Fruit details, use the association to navigate

This option works also when your data is already in your app. and my assumption about a external datasource was wrong.

answered