2

I have a Flow to store email attachments (in .csv format) to SharePoint. Now, I want to use the file in Power-BI from SharePoint. However, I want the file in .xlsx format. Could you please suggest how I can automate the conversion of the .csv file to .xlsx file format?

Thanks in advance. My google search results suggested methods of doing it offline whereas I want to automate it either in Flow or SharePoint if possible.

2 Answers 2

0

You can follow below steps for conversion of csv file to excel through MS Flow:

  1. After uploading the csv file in SharePoint, read its content. (Reference link).
  2. Create a CSV table using the output of csv file.
  3. Create an excel file using that CSV table.
2
  • Can you elaborate on step 3?
    – Snowburnt
    Dec 28, 2020 at 22:15
  • Anyone else getting an error while accessing the link? ______ 'You do not have sufficient privileges for this resource or its parent to perform this action. Click your browser's Back button to continue. ' Mar 4, 2021 at 0:45
0

To fully automate this process you could throw an Azure Function into the mix.

It would not be too complicated to create a (PowerShell) function that:

  1. Read the .csv data from SharePoint using an app registration
  2. Process the data
  3. Create an .xlsx file using Export-Excel
  4. Save this file back to SharePoint

This Azure Function can be triggered by your flow. Take a look at this example on how to get started: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-pnp-provisioning

(This is written about site provisioning, but it includes the bits you need)

Not the answer you're looking for? Browse other questions tagged or ask your own question.