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 / Change the value of a ...
Power Apps
Answered

Change the value of a dropdown by clicking a button

(0) ShareShare
ReportReport
Posted on by

Hi Everbody,

 

i'm looking for a solution to change the value of a dropdown (with values Yes/No)directly by clicking on a button (Save).

 

The value should not be changed by Submitting rather directly by clicking the button in the existing window/view

I'm looking around for a solution for a while but nothing is working properly.

 

Dropdown is called --> DataCardValue7

Button is called --> Save

 

I already tried it with 

OnSelect: 
UpdateContext({DataCardValue7:"Yes"});

but it wasn't changing the value in the dropdown.

 

Any ideas? Thanks for your help!

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Why you use an Dropdown, when the button change the value? 

    But to your question:

     

    Button Onselect ->If(Dropdown1.Selected.Value ="Ja"; Set(VarP;"Nein");Set(VarP;"Ja"))

    Dropdown1 Items -> ["Ja";"Nein"]

     

    Dropdown1 Default -> VarP

     

  • v-siky-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    What is the column type of that column? What is the data source?  Do you use drop down or combo box?

    If the column type is Choices(SP list), please modify your formulas as below, note that don't use contril name as variable name.

    Set(Var,LookUp(Choices('SP list'.ChoiceColumnName),Value="Yes"))

    Set DefaultSelectedItems as below:

    If(IsBlank(A1),Parent.Default,Var)

    Best regards,

    Sik

     

  • Community Power Platform Member Profile Picture
    on at

    Hey Fatih1,

     

    unfortunately your solution isn't working because the Default value says that it  is expecting an record value?

     

    Any ideas to make it work?

  • Community Power Platform Member Profile Picture
    on at

    Hi v-siky-msft,

     

    your idea seems to be on the right way but what do i have to replace A1 with? Because A1 isn't working.

     

    Best regards.

  • v-siky-msft Profile Picture
    on at

    Hi  @Anonymous ,

     

    Sorry for my mistake, please try this:

    If(IsBlank(Var),Parent.Default,Var)

    this formula is to show the defalut value from parent, if you haven't changed the value.

     

    Best regards,

    Sik

  • Community Power Platform Member Profile Picture
    on at

    Hey Sik,

     

    no shown error or something like that but the value in the dropdown(choices) didn't change.

     

    Just to ask if i'm right:

     

    This one is for Button.OnClick Event right?

    Set(Var,LookUp(Choices('SP list'.ChoiceColumnName),Value="Yes"))

    Is this one for Default valuer or for Items Value? I'm not sure If it is Default, what i have to use for Items?

    If(IsBlank(A1),Parent.Default,Var) 

     

    Best regards,

     

    becko

  • Verified answer
    v-siky-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    I think you can try to use combo box,  and set the Items of combo box as below:

    Choices('SP list'.ChoiceColumnName)

    Set the following formula to OnSelect of button

    Set(Var,LookUp(Choices('SP list'.ChoiceColumnName),Value="Yes"))

    Set the following formula to DefaultSelectedItems of combo box

    If(IsBlank(Var),Parent.Default,Var)

    Best regards,

    Sik

    If this post helps, then please click on “Accept as Solution” to help the other members find it more quickly.

     

  • Community Power Platform Member Profile Picture
    on at

    Hey,

     

    i've recognized that it's not working on the PC but working on my mobile device well! So i'm fine with that.

     

    Any idea to lock the button after changing the value and to lock it directly if the value of the combobox is "no" ?

     

    Thanks a lot for your help!

     

    Best Regards,

    becko

  • fpelky-oneida Profile Picture
    7 on at
  • PowerFan95 Profile Picture
    12 on at

    Is it also possible to do this with two variables? For example if variable one is true, select "value A" and if variable two is set to true, select "value B" from a dropdown/combobox?

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard