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

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Invalid expression issue while using empty statement

(0) ShareShare
ReportReport
Posted on by 3,496 Most Valuable Professional

Hi All,

 

I am building a flow that gets info from external source and then passes it as parameters in child flow. I wanted to have a validation on one of the parameter directly in the input box but got an error: "The expression is invalid". Here is my expression:

 

if(empty(body('Parse_Company_Information')?['address']?['state']),"NOT_FOUND",body('Parse_Company_Information')?['address']?['state'])

 

 

I have the same question (0)
  • Pstork1 Profile Picture
    68,271 Most Valuable Professional on at
    Re: Invalid expression issue while using empty statement

    I think you want IsBlank() not Empty().  There is no Empty() function.  IsEmpty is used to see if a table is Empty and IsBlank is used to see if a string is Blank.  So if you are checking to make sure the State value has something in it you use IsBlank().  

  • OOlashyn Profile Picture
    3,496 Most Valuable Professional on at
    Re: Invalid expression issue while using empty statement

    Hi @Pstork1 ,

    I am talking about Power Automate Flow and there is an empty function (as per docs). The functions you are referring are from Power Apps and as far as I know are not applicable to Power Automate.

  • Verified answer
    Pstork1 Profile Picture
    68,271 Most Valuable Professional on at
    Re: Invalid expression issue while using empty statement

    Sorry, I've been jumping back and forth between Power apps and Power Automate.  But the problem you are having is related to my comment.  Empty() is used with tables/records, not values/strings.  What you want is the following.

    if(equals(body('Parse_Company_Information')?['address']?['state'],''),"NOT_FOUND",body('Parse_Company_Information')?['address']?['state'])

     which will test against an empty string.

     

  • OOlashyn Profile Picture
    3,496 Most Valuable Professional on at
    Re: Invalid expression issue while using empty statement

    Hi @Pstork1 ,

    No worries, happens. Unfortunately your suggestion didn't help - I still got the same error. In the end I decided to just have additional condition step and use empty to validate if it is actually null. That worked.

  • Verified answer
    CU-18081211-6 Profile Picture
    9,266 Moderator on at
    Re: Invalid expression issue while using empty statement

    @OOlashyn ,

    There is a small misspeling in @Pstork1 's formula:

    if(equals(body('Parse_Company_Information')?['address']?['state'],''),'NOT_FOUND',body('Parse_Company_Information')?['address']?['state'])

    NOT FOUND should be surrounded by qoutes (because it is a string), not double-qoutes. In rest the formula is great !

     

    Hope it helps !

  • OOlashyn Profile Picture
    3,496 Most Valuable Professional on at
    Re: Invalid expression issue while using empty statement

    Hi @gabibalaban ,

     

    Yes, you were right - the changing from double-quotes to single quotes helped. Thanks!

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 797 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 425 Moderator

#3
developerAJ Profile Picture

developerAJ 319

Last 30 days Overall leaderboard