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 / Invalid expression iss...
Power Automate
Answered

Invalid expression issue while using empty statement

(0) ShareShare
ReportReport
Posted on by 3,498 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'])

 

 

Invalid PA expression.png
Categories:
  • Pstork1 Profile Picture
    69,665 Most Valuable Professional on at

    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,498 Most Valuable Professional on at

    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
    69,665 Most Valuable Professional on at

    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,498 Most Valuable Professional on at

    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,272 Moderator on at

    @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,498 Most Valuable Professional on at

    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

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
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 263

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard