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 / If Statement is consid...
Power Automate
Answered

If Statement is considered Invalid

(0) ShareShare
ReportReport
Posted on by 76

Hi,

 

I have this if statement that I'm like 99% sure it's written correctly, but power automate keeps saying it's invalid. 

 

if(equals(variables('HEM_Blank'),false),concat('<br>',body('Approver1_View_')?'Hardware_x0020_Engineering_x0020']?['DisplayName'],'</br>'),'')

 

The code is above, I'm using this format for multiple variables since it's for an approval route. Basically with this piece, I'm trying to use it in an email body to list who hasn't approved the file yet. So I'm want it to display name if the variable to check whether the field is blank is false (field does not have to be filled out) and to also break line or start a new line with each name. 

 

I know that I can enter and do this myself, but I didn't want to have awkward gaps between names since not every field will be filled out. I have 20 different approval requests, but they will never all be filled out at the same time, but to make my life easier I want to make it so I don't have to do anything and it'll show the names with nice formatting through expressions. 

 

This worked in a different test, but now it doesn't. 

 

I'm also using basically the same format to display the email of the person approving, which works fine. 

if(equals(variables('MEM_Blank'),false),concat(body('Approver1_View_')?['Mechanical_x0020_Engineering_x00']?['Email'],';'),'')

 

Can someone verify that I wrote it correctly? 

 

Thanks!

Categories:
  • Verified answer
    Ed Gonzales Profile Picture
    4,531 Most Valuable Professional on at

    I think you might have a missing open bracket after the question mark - ?['Hardware....

     

    try that and keep us posted.

     

    -Ed

     

     

  • leanns Profile Picture
    76 on at

    @edgonzales 

     

    Thank you for pointing that out! It was the missing piece. Sometimes it's so hard to catch those little mistakes. 

     

    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 249 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 202

#3
David_MA Profile Picture

David_MA 180 Super User 2026 Season 2

Last 30 days Overall leaderboard