cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerUser0
Helper V
Helper V

remove duplicate based on created time

Hi Folks,

 

I have an array, given below, I need to remove the duplicate entry based on two conditions, so for eg, if you look into the array, 2nd and 3rd entry is almost same, just the created time is different, so I need to check if email address is same or not if yes then remove the 3rd entry as the 2nd entry is the latest one. I can do this with if else but lets say in future there are 1000+ entry then this loop will take a long time to complete, I am sure this can be done using Union(), Intersection(), but not able to create one

[
{
"First Name": "Toomas",
"Last Name": "K",
"Email Address": "too@hotmail.com",
"Created Time": "2022-07-24T22:57:54+0000"
},
{
"First Name": "Paul",
"Last Name": "Ls",
"Email Address": "Paul.l@taltech.ee",
"Created Time": "2022-07-21T08:43:27+0000"
},
{
"First Name": "Paul",
"Last Name": "Ls",
"Email Address": "Paul.l@taltech.ee",
"Created Time": "2022-07-21T07:43:27+0000"
}
]

 

Thanks in Advance

 

@ekarim2020 @abm  please help me with this

1 ACCEPTED SOLUTION

Accepted Solutions
Hardesh15
Super User
Super User

@PowerUser0  Please use this-

Edit-your-flow-Power-Automate.png

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

 

View solution in original post

6 REPLIES 6
Hardesh15
Super User
Super User

@PowerUser0  Please use this-

Edit-your-flow-Power-Automate.png

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

 

Hi @Hardesh15 , thanks for your solution, as I mentioned I want to keep that record whose date & time is latest, for eg. out of 2nd and 3rd array value, the 2nd array value should be kept as the time in that is 08:43, so if I place 2nd array in 3rd place this flow will give me the 07:43 time array

@PowerUser0 What is your source of array?

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

@Hardesh15  these are the leads coming from facebook, using, we are making an api call then using parse json we are creating this array after mutiple filters.

@PowerUser0 I was thinking to sort this based on created date so that it will picked latest item. if i get something will post it.

Please 'Thumbs Up' the posts that helped you and 'Accept as Solution' if my post answered your question.

@Hardesh /Gopenly.in

 

Hi @Hardesh15 , I found this article which solved the problem of sorting, here is the link.

http://johnliu.net/blog/2018/12/how-to-implement-sort-with-microsoft-flow-in-3-actions-within-a-loop

Thanks for your help and ideas.

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (6,010)