34
Views
4
Comments
How to merge twi lists applying a filter
Question

Hi,

I have two lists, 

  • UnselectedApplications
  • SelectedApplications


the two lists have the same values in the attributes  exept the IsSelected field,we can have the same element in both UnselectedApplications and selectedApplications list but with a different value in the isSelected attribute(may have False or True).

Now my problem is, I would like to have a list which merge the two lists but if we have an element in both the two lists with Flase in the IsSelected attribute in the first list for example and true in the second list I must keep the element with True in the IsSelected attribute, I need to avoid having duplicated attributes.


could you help please

2023-03-16 16-29-51
Paulo Rosário

Hello You,

It looks like you are overthinking your problem a bit. 

Have you tried to work with only 1 list? If the attributes are the same then you can use just one list and, if needed, split them in two based on the IsSelected value.

Does your use case require 2 different lists? 

Paulo Rosário


UserImage.jpg
you asen

Hi,

thanks for coming back.

as you see I get data from two aggregations so I need to put the result of each agregation in a list then I need to do the login to have one list with the condition explain above.

I have tries many ways but it defeats me.

Do you have any suggestion please ?

2023-03-16 16-29-51
Paulo Rosário

From what I can deduce from your screenshots:

  • You need both selected and unselected applications. 
  • Both Aggregates return a list of applications. 
  • These Applications are the same Entity ( have the same attributes ).
  • The only difference between them is the value of the IsSelected attribute.

Try to use the ListAppendAll function from Outsystems. This will allow you to append all the elements of a list to another list. 

If you could share your oml it would be great.

Thank you.



2023-05-08 05-34-05
Piyali Saha

Hi,

Below is the approach you can follow:

Here is the expected output:


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.