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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Flow Condition If Fiel...
Power Automate
Unanswered

Flow Condition If Field is Blank

(0) ShareShare
ReportReport
Posted on by 13

Hi All,

 

I'm trying to pull records from Salesforce (trigger when record modified) and add them to a SharePoint list. In general, this works, but I also need to check to see if the record has previously been added to the list and Update it if already exists. 

 

So when the Salesforce trigger runs, I use Get Items to get the records on the SP list. Since the record may or may not exist on the SP list, I use a filter query to compare the Salesforce AccountID field of items on the SP list to the current record being modified. I then use a Condition to check to see if the AccountID field from the Get Items comes back empty (no match).  

 

This works as long as there is an existing record on the SP list that matches up. Then the Condition goes down the No branch (AccountID is not empty) and the Update part works fine. But if the record doesn't already exist on the SP list, now then the output of the Get Items is empty, but the Condition still chooses the No branch. 

 

I've tried setting the Condition to check for null and I've also tried checking for "empty" using each of the following expressions:

 

@equals(items('Apply_to_each')?['SF_x0020_Account_x0020_ID'], null)

@empty(items('Apply_to_each')?['SF_x0020_Account_x0020_ID'])

 

Neither one seems to work. Any suggestions?

 

Here's a screen shot of the flow as it is now:

MSFlow check blank.png

Categories:
I have the same question (0)
  • pcgardner Profile Picture
    Microsoft Employee on at

    For the Condition try to the following:

    1. Add a Compose before condition and add in the field you want to look at.
    2. Add another Compose and added express of empty() + compose above you created.
    3. In the Condition now add the output of the 2nd Compose and right side true.
    4. Now move your Create / Update to the correct side.
    5. From the screenshot below they should people be flipped if using all information above.

    2019-01-03_13-59-19.jpg

  • v-yuazh-msft Profile Picture
    on at

    Hi @DaveBrom,

     

    Please refer to screenshot below to create the flow:

    Capture.PNG

     

    The expression in the Condition as below:

    @empty(body('Get_items')?['value'])

     

    Best regards,

    Alice

  • DaveBrom Profile Picture
    13 on at
    I gave this a try, but it still just wants to always go down the one side (the No side). It never seems to recognize it as being empty (or 'true') and going down the Yes side.
  • DaveBrom Profile Picture
    13 on at
    Thanks for the response. I gave this a try as well and I'm still not getting it to go down the Yes branch - everything just wants to go down the No branch whether it's empty or not.
  • DaveBrom Profile Picture
    13 on at
    Thanks for the response. When I try this, it doesn't complain about any failure, but it also doesn't execute the Condition successfully if the field is empty. It just seems to stop there without doing anything else. If there is data in the field, then it works fine on the No side. I just can't get it to go down the Yes side.
  • Verified answer
    v-yuazh-msft Profile Picture
    on at

    Hi @DaveBrom,

     

    Could you please share a screenshot of the configuration of your flow?

     

    I have made a test on my side and don't have the issue that you mentioned.

    The screenshot of my flow as below:

    Capture.PNG

     

    If the output of the Get Items is empty,the flow would run successfully to the If yes branch as below:

    Capture.PNG

     

    Best regards,

    Alice

     

     

    Best regards,

    Alice

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-yuazh-msft,

     

    I have the exact same problem as @DaveBrom but am using the new version of the advanced condition builder. I just cannot get the flow to return true when my array is empty. I just keep getting 'Not Specified'. I can't work out what i'm missing here.

     

    Please see my screenshots below for details.

     

    Thanks for your help,

     

    Mike

     

    Expression

    Expression.jpg

    Get Items.jpg

     

    Not Evaluating.jpg

  • Community Power Platform Member Profile Picture
    on at

    I just realised I have an extraneous apply to each in there that was causing the problem.

     

    All good now!

  • DaveBrom Profile Picture
    13 on at

    Hi @Anonymous 

     

    If you're still looking for an answer on this, the issue is that your expression statement isn't referencing the right objects. You have the expression as:

     

    empty(body('Get_Items')?(['value'])

     

    which is saying that you're looking for the value the Get Items action, but that's not accurate. What you're really looking for, in your case, is the value in the Apply to Each 2 action which has the list of values/items from the Get Items action. So your expression should be like this:

     

    empty(items('Apply_to_each_2')?(['value'])

     

    Hope this helps.

    Dave

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard