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 in Expres...
Power Automate
Answered

If Statement in Expression not Returning Expected Results

(0) ShareShare
ReportReport
Posted on by 1,044

Hello. I've tried for hours to get a text field in an html table to show "Yes', when it's value is yes in the SharePoint list and '' (no value) when the value is "No'.

 

I've initialized a string variable to: 

 

 

 

if(equals(item()?['SetListtxt'], 'Yes'), 'Yes', '')

 

 

 

As a test I added the actual field so I can ensure it's working.

It should view in the HTML table as: [dynamic field value]/[variable] so: Yes/Yes, No/   , etc. but all I'me getting is Yes/  , No/  menaing the variable expression is not working and I dont underdtaand why. I thought it was supposewd to bew as simple as Excel if statements but this is furthest from. 

 

HELP

 

I've included pertinent images for reference.

 

Thanks 

Email.png
Flow.png
SharepointList.png
Categories:
  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @CW ,

     

    Your expression should be used in action 'Create html table' instead of the 'init variable' action because item() function should be used in a loop.

    vxiaochenmsft_0-1670295115462.png

     

    Best Regards,

    Wearsky

  • CW Profile Picture
    1,044 on at

    Tx for your reply, very much appreciated. 

    I tried using the same expression in the create table but it kept saying the expression was wrong (????).
    Why does MSFT have to make EVERYTHING so difficult. If it knows it's wrong, and intellisense has enough to understand whether it's wrong or right then it should provide the proper or corrected expression or at least example.
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @CW ,

     

    Could you share some screenshots?

     

    Best Regards,

    Wearsky

  • CW Profile Picture
    1,044 on at

    Actually what I did was create a new line (header/data) and used this expression:

     

    If(equals(item()?['SetListtxt'], 'Yes'), 'Yes', ' ')

     

    which worked perfect.

     

    Thanks for the suggestion to put it in the Create Table action. 

    I think initially my expression was incorrect. Maybe a ')' in the wrong spot but all working good now. 

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

#2
Henil Profile Picture

Henil 128

#3
anirudhev Profile Picture

anirudhev 124

Last 30 days Overall leaderboard