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

Community site session details

Session Id :
Power Automate - Building Flows
Suggested answer

"Create File" how to force it to raise an error incase the file name already exsits

(0) ShareShare
ReportReport
Posted on by 1,630 Super User 2024 Season 1
I have this create file action:-
 
 
currently if the file name already exsits, a new version of the file will be created, while i wan tto fail this action incase the file name already exsits, but seems i can not find any option to do so, any advice?
 
Thanks
I have the same question (0)
  • VictorIvanidze Profile Picture
    12,637 on at
    "Create File" how to force it to raise an error incase the file name already exsits
  • johnjohnPter Profile Picture
    1,630 Super User 2024 Season 1 on at
    "Create File" how to force it to raise an error incase the file name already exsits
    @VictorIvanidze ok i tried your appraoch to check if the file exsits, using the "Get file metadata", but this action will always fail to find a file even if the file already exsits.
     
    here is the action :-
     
     
    and here what i get for exsisting and none-exsits files:-
    {
      "status"400,
      "message""Route did not match\r\nclientRequestId: fa47d942-7cb5-4e89-bbd4-ed94d422e2b5\r\nserviceRequestId: 953ec7a1-105f-5000-d2f4-ac5f01c1f543"
    }
  • VictorIvanidze Profile Picture
    12,637 on at
    "Create File" how to force it to raise an error incase the file name already exsits
    did you really meet such issue?
    I believe one of 2 users will be able to create a file at any conditions.
  • johnjohnPter Profile Picture
    1,630 Super User 2024 Season 1 on at
    "Create File" how to force it to raise an error incase the file name already exsits
     
    what if 2 users try to add the same file at the same time? then the check might be false for both users!!
  • VictorIvanidze Profile Picture
    12,637 on at
    "Create File" how to force it to raise an error incase the file name already exsits
     
    why? Only one user can create a file. If the file already exists, the flow should behave differently. 
     
  • Ellis Karim Profile Picture
    11,422 Super User 2025 Season 2 on at
    "Create File" how to force it to raise an error incase the file name already exsits
    In the settings for the trigger, you could set the Concurrency Control to 1, so that only one instance of the flow runs:
     
     
    Ellis Karim
    Ellis Karim
    elliskarim.com  |  LinkedIn  |  Bluesky
    If this solved your issue, please mark it as ✅ Accepted Answer. If it helped, feel free to give it a 🩷 Like!
     
     
  • johnjohnPter Profile Picture
    1,630 Super User 2024 Season 1 on at
    "Create File" how to force it to raise an error incase the file name already exsits
    @ the check will fail incase 2 users try to add the same file
  • VictorIvanidze Profile Picture
    12,637 on at
    "Create File" how to force it to raise an error incase the file name already exsits
    Just check if this file exists before creation.
  • johnjohnPter Profile Picture
    1,630 Super User 2024 Season 1 on at
    "Create File" how to force it to raise an error incase the file name already exsits
     
    The problem with this approach, is that the logs will show that the flow failed incase the file does not exsits.. which can confuse the admins .. as they will think that the flow failed while in reality it just did not find the file!!
  • johnjohnPter Profile Picture
    1,630 Super User 2024 Season 1 on at
    "Create File" how to force it to raise an error incase the file name already exsits
     
    same name i am sure thanks

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 797 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 483 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 339

Last 30 days Overall leaderboard