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

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 II
Dual Super User II

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

6 REPLIES 6
Super User II
Super User II

@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 II
Dual Super User II

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

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.

Would you be willing to share your flow with me? I am looking exactly for this flow. Automatically unzip an email attachment and have it save on onedrive with new name so that it overwrites the old file on OneDrive. Your help would be very much appreciated, thank you!

Hi @HansPaul ,

 

Here is the flow. 

 

1.png2.png

@EXCHD, I just want to let you know that your flow is doing it's magic and our team is loving it. Thank you so much for your help and I wish you the best of health!! Cheers Hans.

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (12,340)