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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Read CSV file and crea...
Power Automate
Answered

Read CSV file and create/update list items with logic

(0) ShareShare
ReportReport
Posted on by 1,594

Hi all,

 

I have a CSV file in a SharePoint Online library.

I'd like to create a FLOW that goes through each line of the CSV file and, using a bit of logic, create or update items in a list.

 

By example, if my CSV file is the following:

Last name;First name;Email

SMITH;Allan;a.smith@outlook.com

DOE;John;jdoe@outlook.com

 

If a have a list with the following:

Last name | First name | Email

DOE | John | john.doe@hotmail.com

 

When I run the workflow, I'd like to do the following:

  • when processing first line of CSV file (SMITH), since it does not exist in the list -> creates a new item in the list for SMITH
  • when processing second line of CSV file (DOE), since it already exist but email is different -> update list item to set new email for John DOE

The resulting list would then look like this:

Last name | First name | Email

DOE | John | jdoe@outlook.com

SMITH | Allan | a.smith@outlook.com

 

Is this possible ? Anyone already done something similar ?

 

Thanks for the help,

 

Emmanuel

Categories:
I have the same question (0)
  • fritz77 Profile Picture
    6 on at

    Hi, I'm trying to use your solution but I get a strange behavior: the first 5 rows in Sharepoint list have one field empty while all the others show correctly the field value. I tried to re-run the flow starting from the same excel to update the values and I get the same result.

     

    I checked the input and output of every step of the flow and I can find the correct value in the correct field but not in the Sharepoint list. The excel file is correct, the value in this rows are formatted correctly and are all plain text.

     

    Any idea?

    Screenshot 2023-11-25 alle 13.01.16.png
  • fritz77 Profile Picture
    6 on at

    Hi, I'm trying to use your solution but I get a strange behavior: the first 5 rows in Sharepoint list have one field empty while all the others show correctly the field value. I tried to re-run the flow starting from the same excel to update the values and I get the same result.

     

    I checked the input and output of every step of the flow and I can find the correct value in the correct field but not in the Sharepoint list. The excel file is correct, the value in this rows are formatted correctly and are all plain text.

     

    Any idea?

    Screenshot 2023-11-25 alle 13.01.16.png
  • takolota1 Profile Picture
    4,978 Moderator on at

    Hello,

     

    Please see this template if you want to parse a CSV without 3rd party connectors. It works even if there are commas in the data.

     

    https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/CSV-to-Dataset/td-p/1508191

     

    For this use-case, you can insert a Filter array action after the last Select action to filter the Select output before parsing the JSON to dynamic content.

  • SergiPino Profile Picture
    6 on at

    for problem #2 you can use a flow trigger "when file is created"

    SergiPino_0-1602764100279.png

    then check if this file is the csv converted into .xlsx and if it's the case fire the rest of the flow.

     

    I did this on other flows and works like a charm.

  • Community Power Platform Member Profile Picture
    on at

    Using Shell Scripts you can. Unfortunately there is no such feature in Flow yet. I use VBA macros but that involves manual intervention.

     

    Cheers,

    Aamir

  • Community Power Platform Member Profile Picture
    on at

    can i set the power query to run twice a day?

  • Community Power Platform Member Profile Picture
    on at

    The feature is not available right now. I had a similar issue where I paste my csv in a SharePoint folder and I managed to build a workaround.

    1. Create an Excel file.

    2. Use PowerQuery to read the csv from the Sharepoint.

    3. Use flow to to read the queried table in Excel.

    4. Update/Replace the Csv as required.

     

    Cheers,

    Aamir

     

  • anton-khrit Profile Picture
    197 on at

    You can use Parse CSV action from Plumsail Documents connector. It allows you to convert CSV into an array and variables for each column. Please read this article demonstrating how it works.

     

    Then you can iterate through result array and create items in a SharePoint list according to your logic.

  • R3dKap Profile Picture
    1,594 on at

    Well, on my side I'll never get to the million records...

     

    On the other hand, I totally agree wih you @asdfaf4 about the fact that Excel file paths cannot be dynamic and that's really a pain... Hope this feature will come true one day...

  • asdfaf4 Profile Picture
    on at

    2 potential problems by converting to Excel...

     

    1. Limit of 1 million rows

    2. Using Excel in flow doesn't support dynamics path and filename, you have to select the file within flow.  This defeats the purpose of having a library where a flow fires when a new file being added.  Highly frustrating...

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 245 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 207 Most Valuable Professional

#3
trice602 Profile Picture

trice602 185 Super User 2025 Season 2

Last 30 days Overall leaderboard