cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Issue with Renaming and Moving Excel File in Power Automate after changing the context

Hello Power Automate community!

 

I'm currently facing an issue with renaming and moving an Excel file within my Power Automate flow. The flow retrieves data from a Planner and transfers it to an Excel file named "Vorlage_PlannerDruck - Kopie".

Subsequently, I attempt to rename and move the file, but I encounter an error. Then I copy a template and rename it again to "Template_PlannerPrint - Copy", so the flow works again the next time I run it.

The error message states: "The file id '/Aufgaben Abteilungsdurchlauf/SPS_PS_AWT/Exceldateien_Planner/Vorlage_PlannerDruck - Kopie.xlsx' is not valid." This error occurs consistently, despite trying various troubleshooting steps.

 

I've already ensured that the file ID and path are correct, and I have the necessary permissions to access and modify the file. Previously, the renaming and moving operation worked without any issues until I introduced a step involving the Planner and Excel file manipulation.

I've attempted to introduce a delay using the "Delay" action, but it did not resolve the problem. Additionally, I've considered permission settings, but everything seems to be in order.

 

If anyone in the community has experienced a similar issue or has suggestions for resolving this problem, I would greatly appreciate your insights and assistance. I'm open to alternative approaches or workarounds to achieve the desired renaming and moving functionality. I have added the important part of my flow below.

 

Thank you in advance for your help!

 

Nico_0710_0-1689578558075.png

 

Nico_0710_1-1689578558077.png

 

Nico_0710_2-1689578558078.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Nico_0710 ,

 

The logic is confusing me. Do you want to add new rows to a template excel table based on tasks, copy the excel file to another place and restore the file that has been modified to the initial status?

 

If this is the case, I think you need to change the logic, since a copy of file will have new file identifier, the flow in next run cannot find it dynamically. You can copy the file first, so it's a fixed file that can be selected from OneDrive folder in the List rows present in a table action. File identifier of the copy could be found easily:

vjefferni_0-1689932890357.png

 

The tables in this copy will be exactly the same as the original file, so you can manually type in the table name "Tabelle".

vjefferni_2-1689933297086.png

 

At last, use a dynamic object in the Row to add the new row:

{
    "Aufgabe":CheckListTitleDynamicValue,
    "ColumnName1":DynamicValue1,
    "ColumnName2":DynamicValue2,
    "ColumnName3":DynamicValue3,
    "ColumnName4":DynamicValue4,
    ....
}

vjefferni_3-1689933566705.png

 

You can use this new table to create an HTML table and use it in Email, then after Send an Email action delete this file because this copy is no longer needed.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

22 REPLIES 22
v-jefferni
Community Support
Community Support

Hi @Nico_0710 ,

 

Your screenshots are fuzzy, please edit your post and attach images in large size. Where or which action did you get the error? 

 

Anyway, in those OneDrive actions, you need file identifier instead of file path to identify the file. You can select the file via view folder or manually select file identifier from dynamic contents.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Hi @v-jefferni 

Thanks for your reply.

 

I got the error in the first action "Move or rename a file". 

 

Nico_0710_0-1689582625635.png

Screenshot 2023-07-17 102923.png

 

I hope the images are less fuzzy now. 

 

The problem is that I don't have a "fixed" file that I want to edit. This file is called "Template.xlsx" The flow is to edit a file, rename it and move it from the folder to another.
After this is done, I want to compile a file and rename it back to "Template.xlsx". The reason I am doing this is because the template file is an excel spreadsheet with certain fields that I need to access. After I want to edit this, I want to move it and prepare everything so that my flow can run again.

In the picture below, you can see where the error is triggered.

This is the error message: 

 

{"statusCode":400,"headers":{"Pragma":"no-cache","Transfer-Encoding":"chunked","x-ms-request-id":"edac5722-08d5-456a-9ce0-c1710b6891d2","Timing-Allow-Origin":"*","x-ms-apihub-cached-response":"true","x-ms-apihub-obo":"false","Cache-Control":"no-cache","Date":"Mon, 17 Jul 2023 14:07:12 GMT","X-AspNet-Version":"4.0.30319","X-Powered-By":"ASP.NET","Content-Type":"application/json","Expires":"-1","Content-Length":"200"},"body":{"status":400,"message":"The file id '/Aufgaben Abteilungsdurchlauf/SPS_PS_AWT/Exceldateien_Planner/Vorlage_PlannerDruck - Kopie.xlsx' is not valid.","source":"api.connectorp.svc.ms"}}

If anyone can help me, I would be very grateful.

 

 

Screenshot 2023-07-18 070305.png

 

@v-jefferni 

Do you have any ideas how I could try fixing this flow ?

I don't get it to work.

Hi @Nico_0710 ,

 

The error message has told you that it requires file id rather than file path:

"The file id '/Aufgaben Abteilungsdurchlauf/SPS_PS_AWT/Exceldateien_Planner/Vorlage_PlannerDruck - Kopie.xlsx' is not valid."

vjefferni_0-1689833546899.png

 

If you need dynamic file to be copied, then you should get the file identifier first. You can get it from a previous action such as Get file properties and Create file.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Hey @v-jefferni

thanks for your reply.

 

The action "get file properties" is a Sharepoint action. However, I have the file to be renamed and moved on my desktop and not in Sharepoint.
Is there another possibility with a "One Drive for Busineess" action?

Agnius
Most Valuable Professional
Most Valuable Professional

If your file is on your desktop, try using the File System connector to connect directly to your machine, instead of OneDrive.

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

If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

 

-------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
Regards, Agnius Bartninkas

Hi @Nico_0710 ,

 

Please post a screenshot of the entire flow with its trigger and actions, so I can understand your scenario and logic of the flow, and know some action could be used in this flow. For your question, there is a Get file metadata using path action will return file Id if you save the file in OneDrive for business and the only thing you know of this file is its path.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Then I have to create a connection, but its not working

Agnius
Most Valuable Professional
Most Valuable Professional

Can you provide more context as to what exactly is not working? You need the on-premise data gateway installed on your machine for the File system connector to work.

-------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.
Regards, Agnius Bartninkas

Of course, here is the flow:

 

1.png

2.png

 

3.png

 

4.png

6.png

 

 
v-jefferni
Community Support
Community Support

Hi @Nico_0710 ,

 

The logic is confusing me. Do you want to add new rows to a template excel table based on tasks, copy the excel file to another place and restore the file that has been modified to the initial status?

 

If this is the case, I think you need to change the logic, since a copy of file will have new file identifier, the flow in next run cannot find it dynamically. You can copy the file first, so it's a fixed file that can be selected from OneDrive folder in the List rows present in a table action. File identifier of the copy could be found easily:

vjefferni_0-1689932890357.png

 

The tables in this copy will be exactly the same as the original file, so you can manually type in the table name "Tabelle".

vjefferni_2-1689933297086.png

 

At last, use a dynamic object in the Row to add the new row:

{
    "Aufgabe":CheckListTitleDynamicValue,
    "ColumnName1":DynamicValue1,
    "ColumnName2":DynamicValue2,
    "ColumnName3":DynamicValue3,
    "ColumnName4":DynamicValue4,
    ....
}

vjefferni_3-1689933566705.png

 

You can use this new table to create an HTML table and use it in Email, then after Send an Email action delete this file because this copy is no longer needed.

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

I have tried to do everything as you suggested. Unfortunately, it doesn't work, or I'm probably doing something wrong.
How do I insert and format the dynamic values?
I have inserted a screenshot of my current status.

Screenshot 2023-07-24 082042.png

Hi @Nico_0710 ,

 

Please delete the action then add it again. There should not be any column names inside this action. 

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

I got it, thank you. Now I'll test my flow.

Hi @Nico_0710 ,

 

I notice that you have invalid json error as well in the action. Please note that there should be double quotes to include each dynamic content.

Solved: Re: Updating an excel sheet which is a subject of ... - Power Platform Community (microsoft....

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Hey @v-jefferni,

Thanks for your help. My flow is running and everything seems to work fine so far.

There is no error message or anything else.
However, the Excel file that I copy at the beginning and then edit with the help of the ID cannot be copied.

My flow shows me that it was successful.

However, it does not copy itself to the folder I want.

 

Nico_0710_1-1690272500924.png

The excpression in the picture:   first(body('filter_array'))?['displayName']

 

Thats how my action "Copy file" looks.

I hope you can help me out.

 

Thanks in advance!

Greetings Nico

 

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (835)