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 / Nested If Expression i...
Power Automate
Answered

Nested If Expression is going false all the way through

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to assign a string to a number. It is a lookup column in DataVerse, but for what i am trying to do i decided to do a nested if to get the status. I know there is a column associated with the formattedvalue, but I don't know how to get it yet.

 

If expression:

if(equals(item()?['statusv2'],'1'),'Approved',if(equals(item()?['statusv2'],'2'),'Denied',if(equals(item()?['statusv2'],'3'),'Not Reviewed',if(equals(item()?['statusv2'],'4'),'Trip Approved;Business class airfare denied',if(equals(item()?['statusv2'],'5'),'Pending CVP Approval','n/a')))))

Data structure:

 Screenshot 2022-10-19 101924.png

Categories:
I have the same question (0)
  • Redders Profile Picture
    546 on at

    Try this

    if(equals(item()?['statusv2'],1),'Approved',if(equals(item()?['statusv2'],2),'Denied',if(equals(item()?['statusv2'],3),'Not Reviewed',if(equals(item()?['statusv2'],4),'Trip Approved;Business class airfare denied',if(equals(item()?['statusv2'],5),'Pending CVP Approval','n/a')))))

    ━━━━━━━━━━━━━━━━━━━━━━━━━

     

    If I have answered your question, please mark your post as Solved.

     

    Solved questions helps users in the future who may have the same issue or question quickly find a resolution via search.

     

    If you liked my response, please consider giving it a thumbs up. Thank you!

  • zachm Profile Picture
    Microsoft Employee on at

    I was able to get the formattedvalue to work, but i'd like to understand why my IF didn't work.

     

    This is the format i used as an expression. 

    item()?['cr74d_statusv2@OData.Community.Display.V1.FormattedValue']
  • zachm Profile Picture
    Microsoft Employee on at

    I tried taking out the single quotes, but it still isn't working. did you change anything else?

     
  • Redders Profile Picture
    546 on at

    No, that's all I did. 

    Sorry, I'm not sure then

  • Verified answer
    zachm Profile Picture
    Microsoft Employee on at

    I just added the table identifier? in front and the logic worked. cr74d. Thanks

    if(equals(item()?['cr74d_statusv2'],1),'Approved', if(equals(item()?['cr74d_statusv2'],2),'Denied', if(equals(item()?['cr74d_statusv2'],3),'Not Reviewed', if(equals(item()?['cr74d_statusv2'],4),'Trip Approved;Business class airfare denied', if(equals(item()?['cr74d_statusv2'],5),'Pending CVP Approval','n/a')))))

     

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
David_MA Profile Picture

David_MA 223 Super User 2025 Season 2

#2
Expiscornovus Profile Picture

Expiscornovus 205 Most Valuable Professional

#3
harshdeol Profile Picture

harshdeol 167 Moderator

Last 30 days Overall leaderboard