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 / Condition on "Get Item...
Power Automate
Unanswered

Condition on "Get Item" action (sharepoint)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

In my flow I have a "get item" action based on ID

And I want to put a condition in this action : 

 

If it finds no item : create an item with the ID 

Else : update the item

 

I launch my flow but when it don't find item the "get item" return an error ... "item not found"

 

flow1.png

 

It doesn't go to the next step (condition)

 

flow2.png

 

The condition is : length(outputs('Get_items')?['body/value']) is equal to 0

If the length is 0, the item doesn’t exist yet, I can create it. If it’s not 0, the item already exists and I can use the ID from ‘Get items’ to update it.

 

But the flow failed when he doesn't found item in the "get item" action ...

Categories:
  • Expiscornovus Profile Picture
    33,997 Most Valuable Professional on at

    Hi @Anonymous,

     

    Because there is no value field in the body you can't check for its length. I would use a slightly different approach. You can first check for the statuscode of the output and if the error message starts with Item Not Found. If that is the case you could create the item.

     

    Below is an example of that approach.

     

     

    outputs('Get_Item')['statusCode']

     

    is equal to 404

     

    AND

     

     

    outputs('Get_Item')['body/message']

     

    starts with Item Not Found

    novalue_checkforlength.png

     

    And also make sure you configure run after has failed in the settings of your Condition action btw.

     

    configurerunafter_hasfailed.png

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

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 445

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 300

Last 30 days Overall leaderboard