Skip to main content

Notifications

Community site session details

Community site session details

Session Id : UkCfLx52DQgo1gV9AYqaKJ
Power Apps - Building Power Apps
Answered

Would like to know how to use the 'if else' condition in Power Apps?

Like (0) ShareShare
ReportReport
Posted on 15 May 2023 09:06:03 by 16

Hi, 

 

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 in the dropdown.

 

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.

  • Abardaje1194 Profile Picture
    16 on 15 May 2023 at 14:34:43
    Re: Would like to know how to use the 'if else' condition in Power Apps?

    Hi Ethan, 

    Thank you so much for your help.  My issue has been resolved! 🙂

  • Verified answer
    Ethan_009 Profile Picture
    4,838 Super User 2025 Season 1 on 15 May 2023 at 11:31:37
    Re: Would like to know how to use the 'if else' condition in Power Apps?

    Hi @Abardaje1194 ,

     

    Choices('column name (datasource)')

    Here, your column name is as per datasource and not in the App. 

    You are getting info from ur datasource.

     

    Circular reference means you are directly making same control value dependent on itself somehow.

    Avoid that,

     

    Change the syntax of the code and it will work, don't hard-code -> the app will give suggestions from ur list.

  • Abardaje1194 Profile Picture
    16 on 15 May 2023 at 11:22:51
    Re: Would like to know how to use the 'if else' condition in Power Apps?

    Hi Ethan, 

     

    Thanks for the prompt reply. 

     

    Abardaje1194_0-1684149713639.pngAbardaje1194_1-1684149730683.pngAbardaje1194_2-1684149754533.png

     

  • Ethan_009 Profile Picture
    4,838 Super User 2025 Season 1 on 15 May 2023 at 11:18:24
    Re: Would like to know how to use the 'if else' condition in Power Apps?

    Hi @Abardaje1194 ,

     

    What the error says? can you hover the thick red curly underlined lines?

  • Abardaje1194 Profile Picture
    16 on 15 May 2023 at 11:15:50
    Re: Would like to know how to use the 'if else' condition in Power Apps?

    Hi Ethan, 

     

    Tried but it didn't work. 

     

    Abardaje1194_0-1684149251567.pngAbardaje1194_1-1684149282022.pngAbardaje1194_2-1684149313977.png

    Hope it helps to resolve my issue! 

  • Ethan_009 Profile Picture
    4,838 Super User 2025 Season 1 on 15 May 2023 at 09:51:45
    Re: Would like to know how to use the 'if else' condition in Power Apps?

    Hi @Abardaje1194 ,

     

    So if you wanna set something like that, use this formula

    If(!IsBlank(DataCardValue35.SelectedItems), [Parent.Default], Choices('Approval Status (<DataSource Name>)'.'Not Started'))
    
    //Considered column name as 'Approval Status' and your Table or List name as <DataSource Name>
    //Do replace with your values
    //The ( .'Not Started' ) I considered as Value in Status, make Sure you set yours.
    //You will see your values as you enter the dot 

     

    Hope this helps

  • Abardaje1194 Profile Picture
    16 on 15 May 2023 at 09:23:08
    Re: Would like to know how to use the 'if else' condition in Power Apps?

    Hi Ethan

     

    Tried this logic in DefaultSelectedItems property but it didn't work

     

    If(!Isempty(DataCardValue35.SelectedItems), ThisItem.Status, "Not Yet Started")

     

     

  • Ethan_009 Profile Picture
    4,838 Super User 2025 Season 1 on 15 May 2023 at 09:10:12
    Re: Would like to know how to use the 'if else' condition in Power Apps?

    Hi @Abardaje1194 ,

     

    There's If conditions where you can use If ladder to perform if-else statements.

    If(
     <condition>,
     //operations on true,
     If(
     <condition>,
     //operations on true,
     //operations on false
     )
    )

     

    For Status, you need to set Default in dropdown control and if you have combobox then use DefaultSelectedItems property

    Hope this helps

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

#1
WarrenBelz Profile Picture

WarrenBelz 146,745 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,091 Most Valuable Professional

Leaderboard