Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Create folder if does not exist then insert create file/If folder exist insert create file

Like (0) ShareShare
ReportReport
Posted on 2 Dec 2020 00:08:49 by 1,151

HI All
I hope everyone is doing ok ๐Ÿ™‚
I need some help with a flow i am creating which has me confused.

my desired scenario is
When list item created
Check if folder exists
If does then insert new create file (html)
if not create Folder then insert create file (html) file

I have searched and read numerous post to this forum and others , read blogs and tried to create my requirement from the examples they provide.
So here is my flow  so far

gazzo1967_5-1606866645055.png

All works fine ๐Ÿ™‚

gazzo1967_6-1606866713207.png

next

gazzo1967_7-1606866790235.png

 

 

My issue is that on list folder i get a 'The response is not in a JSON format.' and it says resource not there but it is because on the first test run inserting a sharepoint list item it created the folder! (still has the same fault on List Folder though)

gazzo1967_8-1606866901456.png

So it creates the folder again!

gazzo1967_9-1606866956350.png

 


My FolderName Variable is is

gazzo1967_10-1606867122698.png

Dynamic content is a Person field and  from share point list 'get item'

 

My List folder  is this

gazzo1967_11-1606867198948.png

 

Path  is the Get folder metadata

so
my first pass creating a list item creates a folder if not there!
But if i then create another item with the FolderName with the same data (the reviewer.displayname the same) the condition runs but staes there s no folder when there is so runs the false condition again ๐Ÿ˜ž

The email functions are just for testing 

Must of this was taken adapted from @abm  blog post

Help would be gratefully received ๐Ÿ™‚
Gary 

  • jaiswalmayurMJ Profile Picture
    3 on 21 Sep 2021 at 07:39:00
    Re: Create folder if does not exist then insert create file/If folder exist insert create file

    Thank you, you are are timesaver.

  • gazzo1967 Profile Picture
    1,151 on 02 Dec 2020 at 11:54:09
    Re: Create folder if does not exist then insert create file/If folder exist insert create file

    @v-litu-msft 
    So simple...
    Thank you

  • Verified answer
    v-litu-msft Profile Picture
    on 02 Dec 2020 at 08:04:41
    Re: Create folder if does not exist then insert create file/If folder exist insert create file

    Hi @gazzo1967,

     

    There is no need to confirm the folder if it exists.

    You could use the Create file action directly to create a folder if it does not exist, if exists, then it will create the file under the folder, for example:

    Screenshot 2020-12-02 160354.jpg

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz โ€“ Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Communityโ€ฆ

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 87

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 70 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 48 Super User 2025 Season 1

Overall leaderboard