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 / CreateFile "File alrea...
Power Automate
Unanswered

CreateFile "File already exists", when it does not

(1) ShareShare
ReportReport
Posted on by 15

Hi all,

 

Interesting one. I've got a flow that creates a document, however it is erroring out saying the file already exists, when it does not.

 

A file with the name [DIR]/[FILE].docx already exists. It was last modified by [MyUserAccount]. on [Time] -0700.

 

The file does NOT exist before the flow runs, and it is created properly in the Sharepoint directory. There is only one instance of CreateFile in the flow.

J_2_0-1720432104123.png

 

J_2_1-1720432104268.png

 

 

Has anyone else encountered this? Many thanks for any insight!

Full flow below:

 

J_2_6-1720432174505.png

 

Categories:
I have the same question (0)
  • Michael E. Gernaey Profile Picture
    53,968 Moderator on at

    @J_2 

     

    you are saying it doesnt exist. If true, then it means the file wont be in the environment + path because it failed.

     

    Is the file there? Please show the environment you are deving and running the flow in as well as the error itself.

     

    1. Make sure you aren't accidentally looking in the wrong place (happens to the best of us)

    2. Make sure to validate the environment and full path of the file, versus the Input ./ outputs of the CreateFile so that you can see them next to each other.

     

    If the flow says it exists, it exists.


    If I have helped you, I would really appreciate if you please Mark my answer as Resolved/Answered, and give it a thumbs up, so it can help others

    Cheers

    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

  • J_2 Profile Picture
    15 on at

    Unfortunately, in this case, the files did not already exist.

     

    The Folder of TrainingRecords/Records was completely empty prior to running the flow. After the flow ran, the file was created successfully in the expected directory. The modified time was "A few seconds ago", as in the screenclip above). 

     

    The issue was that it returned an error saying the file already existed, despite having just been created by the flow.

     

     

    To remove all scope for accidental duplication, the flow also appended the current time (down to the second) to the filename, which should have alleviated the issue of files already existing.

     

     

     

    In the end, I removed the "CreateFile" module, and re-added it with the exact same settings - And now its working absolutely fine. Was very strange....

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 167

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard