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:
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.
The filename is unique, however sometimes (not always) I get following error:
I would really appreciate any help. I hope the German UI is no problem.
Thank you and best regards
Patrick
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.
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
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional