web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Overwrite SharePoint l...
Power Automate
Answered

Overwrite SharePoint list instead of appending

(0) ShareShare
ReportReport
Posted on by 163
Hi All,
 
I have a flow that extracts data from a CVS file, saved to SharePoint, that I want to export to a SharePoint List.
I have been able to accomplish this, however, when I run the flow again with updated data in the CVS, the data appends to the existing List. 
I would prefer to overwrite the list with the new data.
Can this be accomplished? Unless, of course, there is a better/smarter way :-)
 
Thank you
Categories:
I have the same question (0)
  • Verified answer
    Mark Nanneman Profile Picture
    993 Moderator on at
    This can be done if the data in your CSV has a unique key.  For example, a 'Serial Number' column that has no duplicates, or an "Email" column with no duplicates, or in the best case an "Id" column with unique GUIDs or other ID values.

    In general the process could be like:

    1. Parse your CSV or Excel import.
    2. Iterate through each row with a "Apply to Each" loop.
    3. Filter your destination database (in your case a SharePoint List) to check for any existing rows that have the same unique key value as your current CSV row.
    4.  Add a compose action that counts the length of the returned array from your fitlered "Get Items" (use the Length() function on the value array output of the get items action.
    5.  Add a condition to create a new item in the list in the case that there are no existing rows with the unique key.
    6.  Add an update action to update either the existing Item or the newly created Item (you could do this by setting a variable to the Item ID of whatever the filter finds as well as setting the same variable to the ItemID of the created item in the create a new item condition branch).

    The flow will go through your CSV rows, Pull a list looking for "ID eq '@{Item()?[CSV_Row_Unique_Id]}'", if it finds one it sets varItemIdToUpdate to the existing SharePoint ItemId, if zero

    If this helped you, please click "Does this answer your question" and give it a like to help others in the community (+ close the ticket)!

    Power Platform Developer | LinkedIn: Mark Nanneman | Blog: Power Stuff  | YouTube: Mark's Power Stuff  |

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 293 Super User 2026 Season 2

#2
trice602 Profile Picture

trice602 186 Super User 2026 Season 2

#3
11manish Profile Picture

11manish 144 Super User 2026 Season 2

Last 30 days Overall leaderboard