Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
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

  • Verified answer
    boca Profile Picture
    7 on at
    Re: Move or rename file in OneDrive for Business: Error 409 - specified item name already exists

    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.

  • v-micsh-msft Profile Picture
    on at
    Re: Move or rename file in OneDrive for Business: Error 409 - specified item name already exists

    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

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >