cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ahmadbutt
Level: Powered On

When I create a new file, I do not get the correct result as in the Excel file?

reply.PNG

replt1 (1).PNG

 

I need to get all the results from the Excel file. I only get the result of the second row. If I delete the second row then I get the results of the first row, but I need all the results and I also need the column names of the values, like the Excel table. 

- I only selected 'id' and 'id2'.

 

I hope someone can help me out.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Jay-Encodian
Level 10

Re: When I create a new file, I do not get the correct result as in the Excel file?

Hey @ahmadbutt 

If I've understood your requirement correctly... you need to get each row from the spreadsheet and add this data to a newly created txt file? If so this Flow should work for you:

1. Get all the rows from the Excel sheet

2. Create a string variable

3. For each Row in the spreadsheet, append the required data to the string variable

4. Create a new file passing the string variable to the 'File Contents' property

As below;

1.png

HTH

Jay

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Jay-Encodian
Level 10

Re: When I create a new file, I do not get the correct result as in the Excel file?

So.... the 'Convert file using Onedrive' only works for file in Onedrive... if the files are in SharePoint, you need to copy them to OneDrive convert them and then use the SharePoint 'Create File' action to place the file... example below, noting you'd also need to add logic to clean-up the 'temp' files in OneDrive.

1.png

 Or you could go for a third party connector like Encodian (lots of additional capabilities above native converters as you would expect) - Convert to PDF

 

2.png

 

HTH

Jay

-------------------------------------------------------------------------

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up.

 

View solution in original post

12 REPLIES 12
Jay-Encodian
Level 10

Re: When I create a new file, I do not get the correct result as in the Excel file?

Hey @ahmadbutt 

If I've understood your requirement correctly... you need to get each row from the spreadsheet and add this data to a newly created txt file? If so this Flow should work for you:

1. Get all the rows from the Excel sheet

2. Create a string variable

3. For each Row in the spreadsheet, append the required data to the string variable

4. Create a new file passing the string variable to the 'File Contents' property

As below;

1.png

HTH

Jay

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

ahmadbutt
Level: Powered On

Re: When I create a new file, I do not get the correct result as in the Excel file?

Thanks! Is it also possible to get the new .txt file exactly like the Excel table?

Jay-Encodian
Level 10

Re: When I create a new file, I do not get the correct result as in the Excel file?

@Hey @ahmadbutt 

I'm not sure what you mean 🙂

Can you provide an example of your input and the txt output you'd like to generate?

HTH

Jay

ahmadbutt
Level: Powered On

Re: When I create a new file, I do not get the correct result as in the Excel file?

@Jay-Encodian, I want to copy the same Excel table in the .txt file. So what u see in the Excel sheet I want the same in the .txt file (as a table).

 

Jay-Encodian
Level 10

Re: When I create a new file, I do not get the correct result as in the Excel file?

Hey@ahmadbutt 

I've had a quick look but I can't see a way of writing in the commands for newline, horizontal tab, etc.

I've tried the standard commands, i..e '\n' '\r\n' and even the hex codes but hey are simply printed as text.

If you need to preserve the formatting couldn't you simply convert to PDF?

1.png

HTH

Jay

-------------------------------------------------------------------------

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up.

ahmadbutt
Level: Powered On

Re: When I create a new file, I do not get the correct result as in the Excel file?

How did you get that in PDF? If I change .txt to .pdf it doesn't work. Can you show it with pictures so I can understand it better?

- I don't understand the things u said about standard commands, i..e '\ n' '\ r \ n' and even the hex codes.

I am new with Flow.😅

Jay-Encodian
Level 10

Re: When I create a new file, I do not get the correct result as in the Excel file?

Hey @ahmadbutt 

As requested;

3.png

 HTH

Jay

-------------------------------------------------------------------------

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up.

 

 

ahmadbutt
Level: Powered On

Re: When I create a new file, I do not get the correct result as in the Excel file?

I use Sharepoint. I don't see that option for Sharepoint. So it can only be done with OneDrive?

 

I have done this already with - copy file and get file metadata. It is a bit the same but you do it with .PDF. 

ahmadbutt
Level: Powered On

Re: When I create a new file, I do not get the correct result as in the Excel file?

Thanks for helping me @Jay-Encodian .

 

Maybe u know this also? I can't load that specific table, from range B8 to I9. U know if this is possible? If I delete all the other things than it works.

apk-screen.png

 

apk1.png

 

Jay-Encodian
Level 10

Re: When I create a new file, I do not get the correct result as in the Excel file?

So.... the 'Convert file using Onedrive' only works for file in Onedrive... if the files are in SharePoint, you need to copy them to OneDrive convert them and then use the SharePoint 'Create File' action to place the file... example below, noting you'd also need to add logic to clean-up the 'temp' files in OneDrive.

1.png

 Or you could go for a third party connector like Encodian (lots of additional capabilities above native converters as you would expect) - Convert to PDF

 

2.png

 

HTH

Jay

-------------------------------------------------------------------------

If I have answered your question, please mark your post as Solved.

If you like my response, please give it a Thumbs Up.

 

View solution in original post

Jay-Encodian
Level 10

Re: When I create a new file, I do not get the correct result as in the Excel file?

@ahmadbuttwe need to be little careful here for the sake of the forum 🙂

If there are new issues we should really post them as new threads and mark the solved issues as solved... it helps other users when they are trying to find resolutions for the same challenges.

My best

Jay

ahmadbutt
Level: Powered On

Re: When I create a new file, I do not get the correct result as in the Excel file?

Oke, will do that. Thanks for the help @Jay-Encodian !

 

If you got more time to help, see https://powerusers.microsoft.com/t5/Building-Flows/Can-t-load-a-Table-from-Excel-spreadsheet-xlsx-fi... 😋

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,923)