cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Creataing a Excel file in Sharepoint

Hello,

 

I am trying to create a Excel file in sharepoint using the Create file action. However i get the below error when i execute my flow.

Excel_Flow_1.PNG

 

I checked my connection and i the account used is the same as the owner of the SharePoint folder. This is how my action looks like:

 

Excel_Flow_2.PNG

 

Not sure what i am doing wrong. Any help would be much appreciated. Thanks.

 

Regards,

Nithin

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Creataing a Excel file in Sharepoint

Hi @Nithin_Vanam 

 

You can't create a CSV file to excel file.  Please follow the below steps to achieve this.

 

1. Read the CSV file content.

2. Declare a compose and press enter Key as value

3. Use the split expression to split the content of CSV file using the above compose 

e.g: 

split(body('Get_file_content_using_path_2'),outputs('Compose'))
 
4. Declare a JSON step and use the below schema
{
"type": "array",
"items": {
"type": "string"
}
}
5. Iterate and get each line of the CSV file.
6. Use split expression delimiter as comma to separate each elements.
7. Use excel connector to create table and insert each column values using step 6
 
Thanks
 
 


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Highlighted
Community Support
Community Support

Re: Creataing a Excel file in Sharepoint

Hi @Nithin_Vanam ,

 

I have made a test on my side and as you said, we couldn't create a .xlsx file from the csv table directly in microsoft flow currently.

As @abm  suggested, I'm afraid that you could only add each row to the excel table if you want to achieve it with microsoft flow.

I would suggest that you could convert the .csv file to .xlsx file manually on your side.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Helper II
Helper II

Re: Creataing a Excel file in Sharepoint

I have got past the initial issue with the connection error. Looks like i was using the data from previous runs before i added the create file action didn't seem to go well with the SharePoint connection.

 

I passed the output of the "Create CSV table" to "Create file" action with the file extension as .xlsx, however when i try to open the file, i get an error that the file format is corrupted and doesn't open the file. But if i save the file as .csv, i can open the file in Excel and i have to save it as .xlsx to play around with the data in the file.

 

Is there anyway to create the .xlsx file directly? Thanks in advance.

 

Regards,

Nithin

Highlighted
Super User III
Super User III

Re: Creataing a Excel file in Sharepoint

Hi @Nithin_Vanam 

 

You can't create a CSV file to excel file.  Please follow the below steps to achieve this.

 

1. Read the CSV file content.

2. Declare a compose and press enter Key as value

3. Use the split expression to split the content of CSV file using the above compose 

e.g: 

split(body('Get_file_content_using_path_2'),outputs('Compose'))
 
4. Declare a JSON step and use the below schema
{
"type": "array",
"items": {
"type": "string"
}
}
5. Iterate and get each line of the CSV file.
6. Use split expression delimiter as comma to separate each elements.
7. Use excel connector to create table and insert each column values using step 6
 
Thanks
 
 


Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Highlighted
Community Support
Community Support

Re: Creataing a Excel file in Sharepoint

Hi @Nithin_Vanam ,

 

I have made a test on my side and as you said, we couldn't create a .xlsx file from the csv table directly in microsoft flow currently.

As @abm  suggested, I'm afraid that you could only add each row to the excel table if you want to achieve it with microsoft flow.

I would suggest that you could convert the .csv file to .xlsx file manually on your side.

 

Best regards,

Alice       

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Helper II
Helper II

Re: Creataing a Excel file in Sharepoint

Hi Alice,

 

Currently i am generating the CSV file in SharePoint. When i try to end it, i get the option to convert which converts to .xlsx. 

I will try the other option of updating row by row and post back about it. Thanks.

 

Regards,

Nithin

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,541)