Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Check if folder is empty - "response is not in a JSON format"

(0) ShareShare
ReportReport
Posted on by 304

Hello,

I'm trying to build a flow that checks if a folder in a SP library is empty and if yes, update an element in a list with a blank value.

I found some threads here that did it with the list folder action and a length function in a condition. Somehow for me it already fails at the list folder action. I always get an error saying "the response is not in a JSON format.  The resource you are looking for has been removed, had its name changed, or is temporarily unavailable." But I can confirm that the folder does exist, so I'm confused. I'll share my flow below:

 

LisKr_0-1714638323619.png

 

Some additional info:

The flow is triggered in a PowerApp and the folder name is also handed over through the app (that's "InstructionID"). That works correctly, as I can see in the action input. But still it says that the folder cannot be found. Is it because it is empty? Or is there another mistake?

And would the steps to check if it's empty and update the list element to blank value work like this? The expression I use is the following:

 

 

 

 

#in the condition
length(outputs('Ordner_auflisten')?['body'])

# for updating the list element:
null()

 

 

Edit: the length and null expressions are working. So the only question remaining is the one with the folder name

 

 

 

  • Verified answer
    LisKr Profile Picture
    304 on at
    Re: Check if folder is empty - "response is not in a JSON format"

    Found a soultion:

    I changed the flow to using a variable for the folder path and in the list folder action I put the variable into a uriComponent() function. That way seems to work.

  • LisKr Profile Picture
    304 on at
    Re: Check if folder is empty - "response is not in a JSON format"

    So I tried using a static folder name, e.g. "1". Then it works perfectly, so the problem must be the input folder name from the power app.

    What I don't understand, If I trigger the flow from the app with input parameter "1", it throws the error, but if I use static "1" it works. I mean, the folder name and the path are the same in both cases?! Where could that behaviour come from? Or am I missing something?

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1