web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Move or rename file in...
Power Automate
Answered

Move or rename file in OneDrive for Business: Error 409 - specified item name already exists

(0) ShareShare
ReportReport
Posted on by 7

Hello everybody

 

I've got a problem using Flows with PowerApps. I try to move some Files into another folder and rename them. For some files, it shows 

{
 "status": 409,
 "message": "The specified item name already exists.",
 "source": "api.connectorp.svc.ms"
}

 

Background:

I created a PowerApp, which lets the user take some photos, saves them to OneDrive for Business and sends an E-Mail to a specific address. To save the images, I use a FORALL(Collection, BATCH(...)) directly in PowerApps, where the images are saved in OneDrive using an Excel file. After this, the Flow is started. It takes some information from PowerApps and sends the E-Mail. This works fine until here. Complete flow looks like this:

image.png

 

The marked steps are the problematic part. My plan is to List all files in the folder, check for all, if they are a folder and, if not, move and rename the file into a subfolder with an variable name taken from the PowerApp. The new file should get a name concated from PowerApp variables and an utc_timestamp to make it unique. 

image.png

 

The filename is unique, however sometimes (not always) I get following error:

image.png

 

I would really appreciate any help. I hope the German UI is no problem.

Thank you and best regards

Patrick

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    Microsoft Employee on at

    Hi @boca,

     

    Thanks for the feedback.

    Usually this error messge would occur when the file (with the same name) already exists in the destination, I saw the file name is configured with the same parameter passed from PowerApps trigger, adding the UTCNow() action.

    Things should be take notice of is within the Apply to each, every single item is performed in parallel, which means the Rename/Move action may happen for two or multiple items at the same time.

     

     

    There are ways to workaround this, could either through PowerApps or Microsoft Flow.

    For Microsoft Flow, we could switch to the Do until action, then take use of variable (recording the number of the items in OneDrive body), then set the variable to decrease until value equals to 0.

     

    Within PowerApps, we need to specify something specific for every item, generating a rendom number with rand() function, then pass it into Flow under the destination File path field.

     

     

    Regards,

    Michael

  • Verified answer
    boca Profile Picture
    7 on at

    Thank you for your reply and your help. The Do until solution is not possible here, since it needs the folder output to be in an Apply to each-Loop to iterate through the files.

    However, I changed the filename to use the original file's id instead of the timestamp. It works fine for now.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 77 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 68

#3
Expiscornovus Profile Picture

Expiscornovus 56 Most Valuable Professional

Last 30 days Overall leaderboard