Sorts Lists Into one list

0
Hi Guys, just wondering if there is a way to merge lists in one big list. i’m gathering users by department in these retrieve actions. id like to merge them so it displays the department  and how many users are in a bar chart for a analytics page.
asked
4 answers
1

Hi Charlie,

 

There is a List Operation Action with the option Union, that adds two list of the same object type together into a new List. If you Union List1 and List2 Into List12 and then List 12 and List3 into List123 you have all the Users combined. 

 

You can use List Operation Action with the Find option, you can determine from what list they came if that would be important to you. 

 

The users are still having an association with their department, so if you would use it in any presentation (grid, or grid2).

 

To count the number of entries in one list, you can use the Aggregate List Action option Count.

 

So if you want only a bar chart from the number of users per department, you don’t need to Union the lists. You can create a new list from a non-persistent Entity with Attributes Like Department, Number that you can populate from the Lists you mention in your Microflow. Than that list can be the source of your chart.

 

If you need more help, let us know.

 

Go Make It

 

 

answered
2

You could use the Add option of the Change List action.

https://docs.mendix.com/refguide/change-list/#32-type

This won’t prevent duplicates, but there is a note in the documentation on how to work around this.

https://docs.mendix.com/refguide/change-list/#notes

I hope this helps.

answered
2
  1. Create a new list or use the first list you retrieved [here ElectronicsUsers]
  2. “Change list” – “Add” – and your retrieved list to the first list
  3. Apply “Union” operator on the result list on itself to get rid of duplicates

 

 

 

answered
2

Hi,

This is possible with union operation, create a new account list and union this and second list then the new list and third list. At the end we will get unique list.

answered