Skip to main content

Notifications

Community site session details

Community site session details

Session Id : rhksJ7pHOUyiykvul0tfiT
Power Apps - Building Power Apps
Answered

How to use else if condition?

Like (1) ShareShare
ReportReport
Posted on 9 Aug 2018 08:39:49 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:
  • Abardaje1194 Profile Picture
    16 on 15 May 2023 at 09:00:08
    Re: How to use else if condition?

    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.

  • Balabhaskar85 Profile Picture
    2 on 20 Dec 2022 at 15:53:40
    Re: How to use else if condition?

    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")

  • 28GREKA Profile Picture
    43 on 31 Aug 2022 at 15:23:12
    Re: How to use else if condition?

    Hi! You can try something like this:

    28GREKA_0-1661959365331.png

     

  • Muhammad_Ali Profile Picture
    12 on 15 Aug 2018 at 07:59:53
    Re: How to use else if condition?

    Thanks, it is working.

  • v-xida-msft Profile Picture
    on 11 Aug 2018 at 02:14:55
    Re: How to use else if condition?

    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

  • Verified answer
    RusselThomas Profile Picture
    4,012 on 09 Aug 2018 at 09:01:24
    Re: How to use else if condition?

    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

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Building Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 42 Most Valuable Professional

#2
mmbr1606 Profile Picture

mmbr1606 41 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 36

Overall leaderboard