cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
pow777777
Level: Powered On

Change dropdown value from button

I have a Sharepoint custom List, the edit form is personalized with power apps, in the list I have a dropdown with 2 values, and at the end of the form I have a Button to change the value of the dropdown to select one of them, this button is just to change the value of the dropdown before save the form.

I was using "updatecontext or If" but is not working, any advice masters?
1 ACCEPTED SOLUTION

Accepted Solutions
pow777777
Level: Powered On

Re: Change dropdown value from button

Finally I found the solution,  The issue was the control, I was using the combobox from SharePoint by default, so I change the control to the DropDownControl, but after that I need to refresh the data source of the DataCard because It was losed when I change the Control, so the Combobox doesn't support the formula UpdateContext, It working fine with DropDown.

Thank you to all people that help me.

God Bless you!

12 REPLIES 12
OneThing
Level 8

Re: Change dropdown value from button

Hi Pow,

You can do this using the Dropdowns Default property.

 

For example, Set the OnSelect propery for the Buttons to be:

UpdateContext({DropdownDefault:"SelectedValue"})

set the Dropdown default to be:

DropdownDefault

This will mean that whenever the button is pressed the value will change to the value entered and the dropdown will change to suit.

 

Just note that the Value you set DropdownDefault to need to be exactly as one of the options.

 

Cheers,
Nicky

pow777777
Level: Powered On

Re: Change dropdown value from button

Thank you OneThing, I try it but I don't know what is my error Smiley Sad

 

I atached 2 images with my situtation

 

I apreciate a lot your help

 

Regards.

 

 

OneThing
Level 8

Re: Change dropdown value from button

Hi Pow,

You don't seem to have any red lines under those 2 commands so they seem correct. What does the app checker on the top right say about the error?

 

Screenshot_1.png

pow777777
Level: Powered On

Re: Change dropdown value from button

Yes it does, the health check detected some issues. but I don't know for what 

 

 

Annotation5.pngAnnotation4.pngAnnotation3.png

Highlighted
OneThing
Level 8

Re: Change dropdown value from button

The Default Value for the Dropdown is looking for a Record rather than a Text value. This is usually the case if the sharepoint entry is a choise or a lookup

 

In this case you will need to set the defaut value to be a record 

{Value:"My Entry"}

 Thanks,

Nicky

pow777777
Level: Powered On

Re: Change dropdown value from button

Now the value of the dropdown not present issues but I don't know now how to change the value in the button 

pow777777
Level: Powered On

Re: Change dropdown value from button

I try this in the button:

 

UpdateContext({Value:"My Entry"})

but is not working 

OneThing
Level 8

Re: Change dropdown value from button

It would be more like

UpdateContext(VariableName,{value:test})

Thanks,
Nicky

pow777777
Level: Powered On

Re: Change dropdown value from button

some thing is wrong with my formula  Smiley Sad
 
I put this on the button but isn't work
 
UpdateContext(DataCardValue26,{Value:"Gantt en Desarrollo"})