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 / Merge CSV and xlsx int...
Power Automate
Unanswered

Merge CSV and xlsx into 1 using a common column (primary key)

(0) ShareShare
ReportReport
Posted on by 47

Hi Community,

 

I have a CSV files generated in SharePoint folder and another Excel file in .xlsx format stored in Document folder in SharePoint. I These 2 files have a common column. I want to use the common column as primary key to merge the 2 files into 1 file.

 

Any advice on how to design the flow to achieve the above? Please provide the details steps as I am quite new to Power Automate.

 

Thanks in advance!

 

Jeremy

Categories:
I have the same question (0)
  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    First you have to think about how to convert the CSV to JSON.

    If the CSV only contains simple values (without " to protect the values), this is doable with built-in PA functions.

    If not, you will need to purchase an action to do this (see "Parse CSV") action.

    You can also create your own action, use PA Desktop, or fiddle with Office scripts.

     

    After this is settled, the rest is straight forward:

    Create an array of the values in you id column and grab the data records from both JSONs with this id.

    You will find an example with 2 different ways to do so here:

    https://powerusers.microsoft.com/t5/Building-Flows/Power-Automate-Create-HTML-Table-rows-staggered-against-colums/m-p/2351663#M261769

     

    If you show me the structure of your JSONs, I can help you to do so.

  • jeremyncs Profile Picture
    47 on at

    Hi, what is the steps in PA should I use to convert CSV format into JSONs and xlsx into JSONs. Attached is the CSV file I downloaded from SharePoint.

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    This is not a CSV, ist's XLSX 😉

  • jeremyncs Profile Picture
    47 on at

    Ignore the attachment extension because the forum doesn't allow CSV to be attached. I just want to show you the headers of each column.

  • Chriddle Profile Picture
    8,436 Super User 2025 Season 2 on at

    Please attach the CSV, just zip it.

  • takolota1 Profile Picture
    4,974 Moderator on at

    @jeremyncs 

     

    Here is a blog explaining CSV to JSON: https://www.tachytelic.net/2021/02/power-automate-parse-csv/?amp

     

    If you do have a file with in-data commas, then you can use this more complicated set-up: https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/CSV-to-Dataset/td-p/1508191

     

     

  • jeremyncs Profile Picture
    47 on at

    Attached is the zip file

  • jeremyncs Profile Picture
    47 on at

    @AlexEncodian When I add Parse CSV into the flow it show the screen below. What should  input for Connection Name and API Key

     

    jeremyncs_0-1695345319097.png

     

  • jeremyncs Profile Picture
    47 on at

    @takolota I will try whether it will work. I have a total of 76 columns and 2000 to 3000 rows, performance might be an issue. Thanks for your advice.

  • takolota1 Profile Picture
    4,974 Moderator on at

    @jeremyncs 

     

    Yes the built in actions can easily handle that.

     

    By the way, what license does your account have?

    And is speed/performance a design consideration for this flow?

     

    I ask because after you convert to JSON there are a couple of options for merging, one is easier to explain & understand, but slower & uses a lot of action calls towards daily limits, the other is much faster & only takes a few actions, but involves more advanced expressions.

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
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard