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 / Set dropdown to the sa...
Power Apps
Answered

Set dropdown to the same selected value as another dropdown when a toggle button is clicked

(0) ShareShare
ReportReport
Posted on by 52

Hi,

 

I have dropdown A, dropdown B and a toggle button. I need to have dropdown B selected value same as dropdown A when the toggle button is clicked. 

 

On Default dropdown B: If(togglebutton.Value,dropdownA.Selected.Value, ThisItem.OwnerGender)

On Items dropdown B: Choices(sharepoint list.OwnerGender)

 

I got "The function "If" has invalid arguements".

 

Thanks for helping.

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    Try

    If(togglebutton.Value,dropdownA.Selected.OwnerGender)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • lras1202 Profile Picture
    52 on at

     

    The error is : "Expected record value"

  • eka24 Profile Picture
    20,923 on at

    Change it to

    Try

    If(togglebutton.Value,dropdownA.Selected.OwnerGender.Value)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • lras1202 Profile Picture
    52 on at

    Same "Expected record value", actually dropdownA.selected.ownergender is not a valid selection, only Value.

     

    If(togglebutton.Value,dropdown.Selected.Value, ThisItem.OwnerGender)  ThisItem.OwnerGender is what needs to be when the toggle button is not selected.

     

     

  • eka24 Profile Picture
    20,923 on at

    Are the dropdown inside a Gallery?

     

    You can try a variable:

    OnSelect of the dropdown;

    Set(VarSelected,dropdownA.Selected.Value)

     

    Then in DropdownB

     If(togglebutton.Value,VarSelected)

    Or

    If(togglebutton.Value,VarSelected.Value)

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • lras1202 Profile Picture
    52 on at

    Not in the gallery, just on the Edit form. 

     

    Tried your formula, still getting "Expected record value"

  • Al_10 Profile Picture
    1,691 Super User 2024 Season 1 on at

    what if you try:

     

    If(togglebutton.Value, {Value: dropdownA.Selected.Value}, ThisItem.OwnerGender)

  • lras1202 Profile Picture
    52 on at

    Still getting the same error. But this formula works:

     

    If(togglebutton.Value,dropdownA.Selected.Value,ThisItem.OwnerGender.Value)

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @lras1202 :

    Could you tell me:

    • What are dropdown A and dropdown B?Combo box or Drop down control?
    • Does OwnerGender allow multiple selections?
    • Does dropdown B allow mutiple selections?(If it is a combo box)
    • What is dropdown A 's Item property?

    Case1:I assume dropdown B is a DropDown control(do not allow multiple selections) and OwnerGender do not allow multiple selections.

    Please try:

    On Items dropdown B:

    Choices(sharepoint list.OwnerGender)

    On Default dropdown B:

    If(togglebutton.Value,dropdownA.Selected.Value, ThisItem.OwnerGender.Value)

    Case2:I assume dropdown B is a Combo box control(do not allow multiple selections) and OwnerGender do not allow multiple selections.

    Please try:

    On Items dropdown B:

    Choices(sharepoint list.OwnerGender)

    On DefaultSelectedItems dropdown B:

    If(togglebutton.Value,LookUp(Choices(sharepoint list.OwnerGender),Value=dropdownA.Selected.Value), ThisItem.OwnerGender)

    Best Regards,

    Bof

     

     

  • lras1202 Profile Picture
    52 on at

    Hi, @v-bofeng-msft ,

     

    Both DropdownA and Dropdown B are dropdowns, all not allowing multiselect.

     

    Your Case1 is the solution! It works!

     

    Thanks again for helping.

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
WarrenBelz Profile Picture

WarrenBelz 542 Most Valuable Professional

#2
Haque Profile Picture

Haque 206

#3
Kalathiya Profile Picture

Kalathiya 201 Super User 2026 Season 1

Last 30 days Overall leaderboard