cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
med219
Regular Visitor

Deleting Duplicate Entries based on specific column

Hi all,

 

I am relatively new used to Sharepoint and Power Automate. At the moment I'm trying to create an HTML table or an array (whichever would be easier) and populate it using the data from just one column of a sharepoint list. From there, I'd like to find and delete duplicate entries based on that column, which in my case will be email addresses. From that point I plan to take the final/new list of email addresses and sent out an email to everyone on it. That portion I think I'll be able to figure out once I've done the first part. I have been working at it unsuccessfully for a while, so any help and/or guidance will be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Jcook
MVP

@med219 

Hello,

 

Check out my POC i just created for you.

 

Here is my SP list for Fruit and QTYHere is my SP list for Fruit and QTYInitialize empty Array, use the get items SP actionInitialize empty Array, use the get items SP actionAdd a loop to loop through the SP list. Use a compose action to add the column item to a Array. using the append to array variable actionAdd a loop to loop through the SP list. Use a compose action to add the column item to a Array. using the append to array variable actionUse union() to remove all duplicates on an array by selecting the array twice in the parameters.. You can then use split() to split each unique itemUse union() to remove all duplicates on an array by selecting the array twice in the parameters.. You can then use split() to split each unique itempic4.png

Union expression:

union(variables('MyArray'),variables('MyArray'))
 
Split Expression:
split(body('Join'),',')
 
 
 
Hope this helps..
 

 

 

Here is my successful runHere is my successful run

 

 

--Josh

 

If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





View solution in original post

3 REPLIES 3
Jcook
MVP

@med219 

Hello,

 

Check out my POC i just created for you.

 

Here is my SP list for Fruit and QTYHere is my SP list for Fruit and QTYInitialize empty Array, use the get items SP actionInitialize empty Array, use the get items SP actionAdd a loop to loop through the SP list. Use a compose action to add the column item to a Array. using the append to array variable actionAdd a loop to loop through the SP list. Use a compose action to add the column item to a Array. using the append to array variable actionUse union() to remove all duplicates on an array by selecting the array twice in the parameters.. You can then use split() to split each unique itemUse union() to remove all duplicates on an array by selecting the array twice in the parameters.. You can then use split() to split each unique itempic4.png

Union expression:

union(variables('MyArray'),variables('MyArray'))
 
Split Expression:
split(body('Join'),',')
 
 
 
Hope this helps..
 

 

 

Here is my successful runHere is my successful run

 

 

--Josh

 

If you like my post please hit the "Thumbs Up" -- If my post solved your issue please "Mark as a Solution" to help others


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





med219
Regular Visitor

Thanks so much for the help. What you've provided me works pretty well, I can see that it creates the array without the duplicates so I'm getting somewhere. I run into some issues after that point. The split is not working for me, but the current array is broken down as I'd like so I'm not sure if I need that step to then create an HTML table or put it in some other format that will allow me to email the list. Right now it emails as "xxxxxxxxx@website.com, xxxxxxxxxxx@website.com, ..." which isn't horrible but doesn't look very good/ isn't easy to read through. I believe your answer may be my solution, I just need to work with it a little more.

Hi @med219 ,

 

If your problem has been solved, please go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (3,018)