cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
EXCHD
Level: Power Up

Rename extracted file in One Drive

Hi,

 

I receive emails with Zip files attached.  I need the files to be extracted and saved in One Drive with the same name. The file is to be overwritten. 

 

I have created a flow:

 

email attachment => create a file in one drive => exctract archive to folder 

 

this flow works.

 

I am struggling to add "Rename file" with a standard name so the file always gets overwritten.

 

Any help will be appreciated.

Capture.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Rename extracted file in One Drive

Hi @EXCHD 

 

In the rename file action, for the File input, you should use the ID of the file and not the name. Can you please make that change and check if you contiue to face the same issue? Please see teh screenshot below for a reference:

lsdkjf.PNG

Hope this Helps!

 

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

3 REPLIES 3
Super User
Super User

Re: Rename extracted file in One Drive

@EXCHD 

Hi there!  Are you getting an error, or what is happening? My understanding of your scope is that you'll have an existing file in that folder, and you want the new extracted archive to replace that file, right?

 

Looking at it the way you've got it now, it looks like there might be potential for things to get confusing if your archive has more than one file.  I think Flow kicked off the Apply to Each because that potential is there, maybe?

 

The other thing is I don't know if Flow likes dynamic values in the file path fields (I've seen this with Excel, but it might be just that connector).  Maybe try breaking the Flow up and test each part individually.  If you know the extract archive part works, then try another Flow that grabs a single file and renames it to a dynamic value as you've got below.  If that works, then the issue has to do with the Apply to Each loop.  That can be fixed (probably) with another variable that is increased with each iteration of the loop (adds a '1' or '2' and so on).  It sounds like your archive won't ever have multiple files, so that shouldn't be an issue.

 

I've seen people use First(), too, to avoid the loops...but I'm not sure exactly how that works.

 

Keep us posted.

-Ed-

 

 

If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Dual Super User
Dual Super User

Re: Rename extracted file in One Drive

Hi @EXCHD 

 

In the rename file action, for the File input, you should use the ID of the file and not the name. Can you please make that change and check if you contiue to face the same issue? Please see teh screenshot below for a reference:

lsdkjf.PNG

Hope this Helps!

 

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

Highlighted
EXCHD
Level: Power Up

Re: Rename extracted file in One Drive

Thanks . I have used "id" and it worked. Also, in the destination file path / was missing before the output. Once I have fixed all of that the flow worked as I wanted to.

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 (5,205)