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!
Solved! Go to Solution.
Hi @becko1001 ,
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.
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
Hi @becko1001 ,
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
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?
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.
Hi @becko1001 ,
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
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
Hi @becko1001 ,
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.
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
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
256 | |
126 | |
85 | |
85 | |
68 |