cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ahmadbutt
Helper IV
Helper IV

How to get the file content of a Excel file that is modified with a new row or created a new row.

content.PNG

 

I don't know how to get the new/updated Excel file in SharePoint. (The SharePoint 'create file' is in a Microsoft Teams location)

 

In 'file Content' I only see the things that are in the condition (so the attributes of 'Add a row into a table' and 'Update a row'). Do some one know how to fill the 'file Content' of the new files if they are created or modified? I just want to copy the new Excel file in a new SharePoint location (Teams). 

content2.PNG

1 ACCEPTED SOLUTION

Accepted Solutions

Can you export your Flow to a zip package and send to support@encodian.com please? we'll take a quick look...

Thanks J

View solution in original post

21 REPLIES 21
Jay-Encodian
Community Champion
Community Champion

Hi @ahmadbutt 

When creating a new file use the SharePoint 'Create File' action.

If you're updating a file you should use the SharePoint 'Update file' action... though the 'Create file' action will overwrite if you have used the same filename.

If you need to do something with a file, send as an attachment, copy to a new location, convert to PDF, you need to use the SharePoint 'Get file content' action, and optionally use the 'Get file metadata' to obtain the filename etc.

The SharePoint 'Get file content' action retrieves the file which is contained within the 'File Contents' property... the file encoded as a Base 64 string.

Example below which shows how to obtain the file:

1.png

 

In your example, after the Excel actions have made changes to the target file, you need to use the SharePoint 'Get File Content' action to get the file.

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.

@Jay-Encodian I tried it with 'get file content' but I get a error. Error: file not found. As the file identifier I tried the ID of the SharePoint list and also of the Excel file. I just get the same error.

 

Filenotfound.PNG

 

 

 

Hey @ahmadbutt 

If your getting a 404 error, its because the action is not configured with the correct information.

I think after you've updated the Excel you trying to copy to another location in SharePoint? In which case you simply need to point the 'Get file content' action at the same fail the excel actions are pointed at

HTH

Jay

Hey @Jay-Encodian.

That did not work for me. Is there something else than 'get file content? I need to save the updated Excel file in another location in SharePoint. 

 

I used create file only and that works. I only can see the updated rows if selected, but not all the other rows if selected. The updated rows are correct but not the rows that already exist. Is there something I can do with that? The updated rows I get but not all the other rows in the file.

Hey,
If you just need to copy a file use the SharePoint ‘Copy File’ action.
But... using the ‘Get File Content’ and then ‘Create File’ or ‘Update File’ would also work, if they aren’t working it because your passing bad configuration data... in which case it’s likely the ‘Copy File’ action won’t work either.
Try the copy action and it it doesn’t work please post some screen shots of the configuration of the actions.
Cheers J

@Jay-Encodian I think the error is from the 'File identifier' because I don't know what that is for the updated file. I tried it also with the Excel ID. The error 404, I get this from the 'get file content'

I did this:

exceltabel.PNG

filecontent.PNG

error.PNG

 

 

 

Hey @ahmadbutt 

Yes, the 'Id' property and 'Identifier' property hold different values for identifying a document... the 'Id' is an int and not the path to the file.

If you can't see the 'Identifier' value use the 'Get File Properties' action to get it:

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

 

vanhem.PNG

 

Above is your Flow, below mine.  

werktniet.PNG

@Jay-Encodian Id is the same as 'Identifier', but that doesn't work. If I use the Id of when a item is created, that works but it copy nothing...

Yellow marked is the same, but its Dutch language. 

Hey @ahmadbutt 

Why are you manually hard setting the ID to 1? this would only ever point to the first file which was added to the SharePoint library... and if that is deleted you'll get a 404.

Jay

@Jay-Encodian If I use the Id of when a item is created, that works but it copy nothing... I just tried 1 to get output, but I got the 404 error. I only can select the Id of when a item is created. If I do, in the SharePoint/Teams location nothings happens. It only makes a .txt file.  
 niets.PNG

 

@ahmadbutt 

The reason it's creating a txt file is because your setting the filename property of the 'Create File' action as 'test.txt... would you not pass the SharePoint 'Filename with extension' property?

HTH

Jay

@Jay-Encodian If I do 'Filename with extension' in File name than I also don't get data from the updated Excel file. The File name is not important, I need to create a file that got the updated data from the Excel file. And if I don't but .txt after the file name than I can't open it...

@ahmadbutt 

That doesn't really make sense 🙂

The 'Get File Content' action retrieves the file as a Base64 encoded string... held in the 'File Contents' property.

The 'File name with extension is provided by 'Get File Properties' or similar and is not connected in anyway to the 'Get File Content' action... they are totally independent calls to SharePoint getting different data. You associate logically by making sure the actions point at the same file...

By creating a txt file you are writing the Base64 string straight into a text file... but given your TXT file is empty the 'Get File Content' action is not working... otherwise you'd have a big encoded string in the TXT file.

This should be a simple Flow... the Excel actions and the SharePoint actions which get file properties and file content should all be pointing at the same file?

As per previous posts; you should really use the SharePoint action related to what you're doing... i.e. if you are creating a new file use 'Create File', if you;re updating then 'Update File' and if you're copying a file to new location use 'Copy File'....

If you're Excel actions are working then they are correctly pointed to a file... you surely just need to point the SharePoint actions at the same file?

HTH

Jay

Ah... I had to use the action copy file as you said before... I run the Flow the first time and it copy the file correct. But the second time it didn't replace it direct as the first time. Do I need to wait for the change longer than the first time? I waited 10 minutes and it didn't replaced the file.. Do I need to use the get file content still? I got this now:nudit.png

 

@ahmadbutt 

If the copy file is set to replace the file it should just work... did you check the timestamp in SharePoint to see the last time the file was modified? Have you checked the Flow run and examined the output of the 'Copy File' action?... when the action completes the file should have been updated.

HTH

Jay

2e.PNG1e.PNG3e.PNG

@Jay-Encodian Everything runs good but the file didn't replace with the new/modified file..

The Excel file gets updated but the copy action, replace file didn't do anything.. 39 minutes ago the file was modified, but I just run the Flow now and 10 minutes ago also...

@ahmadbutt 

If I've understood your Flow then your:

1. Updating an Excel File

2. Copying the updated Excel file to a new location

So, if the file is not being updating in the destination location... can you confirm that the source file has been changed and that the copy file action is pointing to the source and destination files? Can you also share the output of the Copy file action from the run history...

Thanks J

@Jay-Encodian Yes, you understand my Flow correct.

The source file has been changed and the copy file action is pointing to the source and destination files. Yes.

1e.PNG2e.PNG

I run the Flow today and it changed the first time direct and the Excel file was copied correct. The second time it didn't change again, same as yesterday... I tried it more than 4 times now..

- I don't get a error when I run the Flow. 

- the Excel file is updated when a row is created/modified. 

- It doesn't change when I use the copy file action. 

- After I run it 8 times or so it changed but it didn't take the last row when I added it...

Can you export your Flow to a zip package and send to support@encodian.com please? we'll take a quick look...

Thanks J

Helpful resources

Announcements

Celebrating the May Super User of the Month: Laurens Martens

  @LaurensM  is an exceptional contributor to the Power Platform Community. Super Users like Laurens inspire others through their example, encouragement, and active participation. We are excited to celebrated Laurens as our Super User of the Month for May 2024.   Consistent Engagement:  He consistently engages with the community by answering forum questions, sharing insights, and providing solutions. Laurens dedication helps other users find answers and overcome challenges.   Community Expertise: As a Super User, Laurens plays a crucial role in maintaining a knowledge sharing environment. Always ensuring a positive experience for everyone.   Leadership: He shares valuable insights on community growth, engagement, and future trends. Their contributions help shape the Power Platform Community.   Congratulations, Laurens Martens, for your outstanding work! Keep inspiring others and making a difference in the community!   Keep up the fantastic work!        

Check out the Copilot Studio Cookbook today!

We are excited to announce our new Copilot Cookbook Gallery in the Copilot Studio Community. We can't wait for you to share your expertise and your experience!    Join us for an amazing opportunity where you'll be one of the first to contribute to the Copilot Cookbook—your ultimate guide to mastering Microsoft Copilot. Whether you're seeking inspiration or grappling with a challenge while crafting apps, you probably already know that Copilot Cookbook is your reliable assistant, offering a wealth of tips and tricks at your fingertips--and we want you to add your expertise. What can you "cook" up?   Click this link to get started: https://aka.ms/CS_Copilot_Cookbook_Gallery   Don't miss out on this exclusive opportunity to be one of the first in the Community to share your app creation journey with Copilot. We'll be announcing a Cookbook Challenge very soon and want to make sure you one of the first "cooks" in the kitchen.   Don't miss your moment--start submitting in the Copilot Cookbook Gallery today!     Thank you,  Engagement Team

Announcing Power Apps Copilot Cookbook Gallery

We are excited to share that the all-new Copilot Cookbook Gallery for Power Apps is now available in the Power Apps Community, full of tips and tricks on how to best use Microsoft Copilot as you develop and create in Power Apps. The new Copilot Cookbook is your go-to resource when you need inspiration--or when you're stuck--and aren't sure how to best partner with Copilot while creating apps.   Whether you're looking for the best prompts or just want to know about responsible AI use, visit Copilot Cookbook for regular updates you can rely on--while also serving up some of your greatest tips and tricks for the Community. Check Out the new Copilot Cookbook for Power Apps today: Copilot Cookbook - Power Platform Community.  We can't wait to see what you "cook" up!    

Welcome to the Power Automate Community

You are now a part of a fast-growing vibrant group of peers and industry experts who are here to network, share knowledge, and even have a little fun.   Now that you are a member, you can enjoy the following resources:   Welcome to the Community   News & Announcements: The is your place to get all the latest news around community events and announcements. This is where we share with the community what is going on and how to participate.  Be sure to subscribe to this board and not miss an announcement.   Get Help with Power Automate Forums: If you're looking for support with any part of Power Automate, our forums are the place to go. From General Power Automate forums to Using Connectors, Building Flows and Using Flows.  You will find thousands of technical professionals, and Super Users with years of experience who are ready and eager to answer your questions. You now have the ability to post, reply and give "kudos" on the Power Automate community forums. Make sure you conduct a quick search before creating a new post because your question may have already been asked and answered. Galleries: The galleries are full of content and can assist you with information on creating a flow in our Webinars and Video Gallery, and the ability to share the flows you have created in the Power Automate Cookbook.  Stay connected with the Community Connections & How-To Videos from the Microsoft Community Team. Check out the awesome content being shared there today.   Power Automate Community Blog: Over the years, more than 700 Power Automate Community Blog articles have been written and published by our thriving community. Our community members have learned some excellent tips and have keen insights on the future of process automation. In the Power Automate Community Blog, you can read the latest Power Automate-related posts from our community blog authors around the world. Let us know if you'd like to become an author and contribute your own writing — everything Power Automate-related is welcome.   Community Support: Check out and learn more about Using the Community for tips & tricks. Let us know in the Community Feedback  board if you have any questions or comments about your community experience. Again, we are so excited to welcome you to the Microsoft Power Automate community family. Whether you are brand new to the world of process automation or you are a seasoned Power Automate veteran - our goal is to shape the community to be your 'go to' for support, networking, education, inspiration and encouragement as we enjoy this adventure together.     Power Automate Community Team

Hear what's next for the Power Up Program

Hear from Principal Program Manager, Dimpi Gandhi, to discover the latest enhancements to the Microsoft #PowerUpProgram, including a new accelerated video-based curriculum crafted with the expertise of Microsoft MVPs, Rory Neary and Charlie Phipps-Bennett. If you’d like to hear what’s coming next, click the link below to sign up today! https://aka.ms/PowerUp  

Tuesday Tip | How to Report Spam in Our Community

It's time for another TUESDAY TIPS, your weekly connection with the most insightful tips and tricks that empower both newcomers and veterans in the Power Platform Community! Every Tuesday, we bring you a curated selection of the finest advice, distilled from the resources and tools in the Community. Whether you’re a seasoned member or just getting started, Tuesday Tips are the perfect compass guiding you across the dynamic landscape of the Power Platform Community.   As our community family expands each week, we revisit our essential tools, tips, and tricks to ensure you’re well-versed in the community’s pulse. Keep an eye on the News & Announcements for your weekly Tuesday Tips—you never know what you may learn!   Today's Tip: How to Report Spam in Our Community We strive to maintain a professional and helpful community, and part of that effort involves keeping our platform free of spam. If you encounter a post that you believe is spam, please follow these steps to report it: Locate the Post: Find the post in question within the community.Kebab Menu: Click on the "Kebab" menu | 3 Dots, on the top right of the post.Report Inappropriate Content: Select "Report Inappropriate Content" from the menu.Submit Report: Fill out any necessary details on the form and submit your report.   Our community team will review the report and take appropriate action to ensure our community remains a valuable resource for everyone.   Thank you for helping us keep the community clean and useful!

Users online (5,306)