web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / IF condition for dropdown
Power Apps
Answered

IF condition for dropdown

(0) ShareShare
ReportReport
Posted on by

i have 2 dropdown choice column from sharepoint , when user select 1st dropdown ,it automatically display required value in 2nd dropdown.

 

below code i added in dropdown on change of 2nd one but it is not working any idea how to fix it ?

 

If(DataCardValue7.Selected.Value="A","Approved","rejected")

Categories:
I have the same question (0)
  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    This should be added in the 'Default' property of the dropdown, not the change property.

  • venky232 Profile Picture
    on at

    i added below code in default properties of dropdown of other coloumn. it is not working.

    If(DataCardValue7.Selected.Value="A","Approved","rejected")

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    It may be a ComboBox and not an actual dropdown.   If there is a property called 'DefaultSelectedItems', then your formula should go there.

  • venky232 Profile Picture
    on at

    Issue
    Expected Record value.
    The property on this control expects Record
    values. The rule produces Text values which are
    incompatible.
    Location
    DataCardVaIue8
    . Default
    Haw to fix
    Change the rule to produce a {0} value.

  • Verified answer
    JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    I need to know a little bit more about your 2nd dropdown.   I think it might be a combobox.   You can verify this by selected the dropdown and looking at the top of the data pane.

     

    datapane.jpg

     

    If it is a combobox, you will need to put the formula in the 'DefaultSelectedItems' property and not the Default property.

     

    Try changing it like this:

    If(
    DataCardValue7.Selected.Value="A",
    ["Approved"],
    ["Rejected"]
    )

     

    You will also want to provide some logic as to when this applies.  This ensures that if the item is in view mode or being edited, it keeps the original value until it's changed.  Something like this:

     

    Switch(
     DataCard7.Selected.Value,
     "A", If(FormX.Mode <> FormMode.View, ["Approved"], ["Rejected"],
     Parent.Default
    )
    

     

  • venky232 Profile Picture
    on at

    yes it is combobox it is working if i add if condition in 'DefaultSelectedItems' property.

    but where to add switch condition. my combobox is in view mode

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    The Switch condition is just an expanded version of the first condition.   Now that you know the first condition works, replace it with the Switch condition and then test.   It uses the Mode of the entire form, not the combobox.

     

    When someone opens an item in SharePoint without clicking edit, it's initially in View mode.   When in view mode it needs to show the current saved value.    When the form is in Edit or New mode it will display the value based on the selection in DataCardValue7.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 88

#2
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 45

Last 30 days Overall leaderboard