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 / Would like to know how...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on 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.

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    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

  • Abardaje1194 Profile Picture
    16 on at

    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 Moderator on at

    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 at

    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 Moderator on at

    Hi @Abardaje1194 ,

     

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

  • Abardaje1194 Profile Picture
    16 on at

    Hi Ethan, 

     

    Thanks for the prompt reply. 

     

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

     

  • Verified answer
    Ethan_009 Profile Picture
    4,838 Moderator on at

    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 at

    Hi Ethan, 

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

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard