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 Apps / How to use else if con...
Power Apps
Unanswered

How to use else if condition?

(1) ShareShare
ReportReport
Posted on by 12

Hi,

 

I want to use else if condition over Display Mode property of field, e.g. If <Condition>, <DisplayMode.Disabled> else if <Condition>, <DisplayMode.Disabled> else <DisplayMode.Edit>.

 

Thanks

Categories:
I have the same question (0)
  • Verified answer
    RusselThomas Profile Picture
    4,014 on at

    Hi Muhammad_Ali,


    There are a couple of ways to do this using either If() or Switch() functions.

    The If() function was also updated to operate much like a Switch statement, so you can probably just use If()

     

    If( Condition, ThenResult [, DefaultResult ] )
    If( Condition1, ThenResult1 [, Condition2, ThenResult2, ... [ , DefaultResult ] ] )

     

    or looking at it another way;

     

    If(condition, trueresult, condition, trueresult, condition, trueresult, defaultresult)

     

    For your example;

    If(condition, DisplayMode.Disabled, condition, DisplayMode.Disabled, condition, DisplayMode.Edit)

    Hope this helps,


    RT

     

  • v-xida-msft Profile Picture
    on at

    Hi @Muhammad_Ali,

     

    The else if condition is not supported within PowerApps currently. I think the If function could achieve your needs within PowerApps.

     

    The standard formula format of If function as below:

    If( Condition, ThenResult [, DefaultResult ] )
    If( Condition1, ThenResult1 [, Condition2, ThenResult2, ... [ , DefaultResult ] ] )

    On your side, please take a try to set the DisplayMode property of the field to following formula:

    If(
    Condition1,
    DisplayMode.Disabled,
    Condition2,
    DisplayMode.Disabled,
    DisplayMode.Edit
    )

    More details about the If function in PowerApps, please check the following article:

    If function

     

     

    Best regards,

    Kris

  • Muhammad_Ali Profile Picture
    12 on at

    Thanks, it is working.

  • 28GREKA Profile Picture
    43 on at

    Hi! You can try something like this:

    28GREKA_0-1661959365331.png

     

  • Balabhaskar85 Profile Picture
    2 on at

    Hi, i want to use below sql query to dax function  CASE WHEN "DimCard"."CARDSTATUS"= 'A' THEN count("CardsTxn"."CARDACCOUNTNUMBER") ELSE null END / count("CardsTxn"."CARDACCOUNTNUMBER")

  • Abardaje1194 Profile Picture
    16 on at

    Hi, would like to know how to use the 'if else' condition in Power Apps?

     

    I have this logic that if this is a new request the status should be 'Not Yet Started' but once it is submitted the status should be the one that chose by the requestor.

     

    For Example: When I open this app and want to create a new one the status should be 'Not yet Started' then after I populate all the fields and in status dropdown I chose 'Approval Request' then once I click the submit button the status should be 'Approval Request'. Thank you in advance.

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 Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard