Skip to main content

Notifications

Community site session details

Community site session details

Session Id : k1vODPOhaHS9y6dI+kibNa
Power Automate - Building Flows
Answered

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

Like (0) ShareShare
ReportReport
Posted on 24 Oct 2017 15:48:14 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 25 Oct 2017 at 08:13:44
    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 25 Oct 2017 at 06:59:20
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started