cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
acolyter
Helper II
Helper II

Replace old item with new one with updated information

Hi,

 

I'm trying to build a flow which will help me filter duplicates in a sharepoint list. Example: there's an item in sharepoint list with EventID, and when there's added a new item with that same EventID, I want to replace the old one for the newer one. Is it possible? 

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
abm
Super User
Super User

Hi @acolyter 

 

If you using the same list then query using the Get List Items using Filter Query. Check if the count is > 1. This means you have some duplicate values. Check the trigger id is not equal to Get List items Id of your earlier query. Under the Yes you can delete the old one. This way it will always keep the latest record without duplicates.

 

Thanks



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

View solution in original post

7 REPLIES 7
Hardesh15
Super User
Super User

@acolyter Yes you can do this. Please use filter query & length() function to update existing list item.

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

@Hardesh /Gopenly.in

abm
Super User
Super User

Hi @acolyter 

 

Yes it is possible. You may need to use Get Items using the filter query to determine whether the item already exists or not. You mentioned when a new item with same event id created is that on the same list? 

 

Power Automate - How To Filter SharePoint List String Column - YouTube

 

Thanks



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Yes, I need to replace the old information about the event (same event - same EventID but for example different time) with the new information that is in this case a new item. So if there's a item with an event with EventID and there's a new information about this event that is stored in another sharepoint item, just delete the old one and replace it with the new one with updated information.

 

@abm 

Hi @acolyter 

 

Thanks for your reply. Use the filter to identify whether the record exists or not. Did you checked the video tutorial? If you need any further help please let me know.

 

Thanks



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Hi @acolyter 

 

Follow the below

 

image.png

 

The expression to check the record exists is as follows:

 

length(body('Get_items')?['value'])
 
Thanks


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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials
abm
Super User
Super User

Hi @acolyter 

 

If you using the same list then query using the Get List Items using Filter Query. Check if the count is > 1. This means you have some duplicate values. Check the trigger id is not equal to Get List items Id of your earlier query. Under the Yes you can delete the old one. This way it will always keep the latest record without duplicates.

 

Thanks



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

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog
Power Automate Video Tutorials

Thanks. That works for me. 

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,696)