2054
Views
3
Comments
Solved
Remove duplicate record from list

I am getting data from restful service and have duplicate records. I wanted to remove these duplicate records.

I have tried using ListDistinct  function with no luck. In following screen, GetCredits is restful services and it is returning duplicate record. Please note I can't control SQL. So i will need to remove duplicate value programmatically. 


2020-09-01 10-42-42
Stefano Valente
Solution

Your credit_id is different. this is why the distinct function doesnot see it as the same record.


If this field does not make your record different, you could create another list without that field and do a distinct.

UserImage.jpg
Sarah2016

Thanks for point that out. It worked.  I have added following code and stored in local variable to get a unique list.



2020-12-04 11-01-48
Francisco Simão

Hi Sarah? 


Did you already try to save the information in one variable and use the list distinct?

If it does not work, loop your entire list against every record in the list using any unique identifier in the list.

2020-09-01 10-42-42
Stefano Valente
Solution

Your credit_id is different. this is why the distinct function doesnot see it as the same record.


If this field does not make your record different, you could create another list without that field and do a distinct.

UserImage.jpg
Sarah2016

Thanks for point that out. It worked.  I have added following code and stored in local variable to get a unique list.



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