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

View solution in original post

Thanks. That works for me. 

Helpful resources

Announcements
Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,295)