Skip to main content

I have an Excel file that is uploaded to Microsoft SharePoint. I cannot upload it to any other file storage location than SharePoint. It cannot be in any format other than .xlsx.

 

The trigger for my Zap needs to be when one such Excel file is added to a specific SharePoint folder.

 

I need to take the resultant file and get its contents as a .csv such that I can then use the .csv data as the body of a different API request. However I do not understand how I can get the body of the Excel file as a .csv using only the actions provided by Zapier.

 

Here is what I have tried so far:

Here is (part of) the response data for my trigger action regarding the file that was uploaded (titled ‘Book1.xlsx):

 

I created an action for “Files by Zapier” with the event “Line Items From CSV”, but the data produced using this initial “File” object from the above screenshot is not the human-readable text I put in the Excel spreadsheet:

 

 

Instead, I tried to use a Microsoft Sharepoint API to retrieve the contents of the file, as suggested in this post:

 

This was the URL I used. I tried it once with /%value and once without it. The resulting bodies looked as follows.

With /$value:

 

Without:

(None of the JSON options here contain the actual file contents.)

 

If I try to do the same Line Items From CSV, but using one of these response bodies (or even the “full response data” object that is returned), the data I receive is still not the data within the file.

 

What do I need to do to make this work?

Hi @kdietz, welcome to the Community! 😁

With the API request it appears that it’s sending the file in XML format:
f1bfe5474d84ca6ad02de94122314fa4.png

If it’s supplying an XML file you could use Files by Zapier’s Text From File action as that should be able to read an XML file and return the data from it as plain text. Then you could use a File From Text (Files by Zapier) action to convert that plain text into a CSV file.

If that doesn’t work, you could try using use a file conversion app to carry out the file conversion from XML to CSV. Perhaps you could use an app like CloudConvert or ConvertAPI for example. Both of those apps appear to have actions that should allow you to convert an Excel file into a CSV file. 

Hope that helps to get you pointed in the right direction. If you run into any further trouble with this or have any questions just let us know! 


Hello kdietz,

PDF.co provides a solution for converting your Excel files to CSV format. By integrating PDF.co with Zapier, you can effortlessly convert your Excel files to CSV format. For more detailed information, please refer to our documentation on the Excel to CSV API available at the following link: API Docs.

If you have any questions or require assistance, please feel free to reach out to us.