To sort the values in String_split

To sort the values in String_split

  

Hello,

I would like to check are we able to sort the values after the string split function. 

For example after string split function, my list value are 

a

b

a

c

b


Can i sort the list value to 

a

a

b

c


Thanks

Solution

Hello Jace


If you're handling a list, you can use the ListSort action (from System)


Regards,

Ângelo

Solution

Hello Jace,


Ângelo suggested the best option here. I have used the ListSort action in the example below


Have a look

https://atul8255.outsystemscloud.com/LocalListPagination/Home.aspx


Hope this helps :)

Thanks and Regards,
Atul Patel

Hello,

Ok noted. Thanks.

One more question, are we able to remove duplicate after the string split function?

Hello Jace

I don't believe there's an action to remove duplicates from a list. It's certainly feasible, but removing duplicates is always cumbersome as you'll need  to iterate through the list N  times to remove all duplicates. 

Are you in a position where you can prevent the list to have duplicates to start with? In this case, you'd only need to iterate through the list each time you enter a new record in it. For example, when you're inserting a value X, you'd make a ForEach to run through the record and compare the current with the value X, if the ForEach ends without finding a match, then you'd append the value to the list


Regards,

Ângelo