Hi,
I have a Form with a Dropdown box. I want to change the value shown in the Dropdown Box in the Form from "A" to "B" by selecting a button. What do I need to set and where?
Many Thanks!
Hi,
I have a Form with a Dropdown box. I want to change the value shown in the Dropdown Box in the Form from "A" to "B" by selecting a button. What do I need to set and where?
Many Thanks!
Mmm - it didn't work 😞 I don't get an error but nothing happens) Here is what I have done:
Ok, try changing the Default property of Dropdown1 to or leave the formula bar empty:
Parent.Default // or empty
And then the DataCard1.Default of the Dropdown1:
dropDownValue
In my case I added this in my button to update the variable as a record for the dropdown:
// OnVisible property of the screen
UpdateContext({
dropDownValue: {Value: "A"}
});
// Button OnSelect
UpdateContext({
dropDownValue: {Value: "B"}
})
If you have any questions or feedback, please let me know. Have a great day! 😊
-----------------------
PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻
Thanks! That worked if I moved the dropdown out of the Form (connected to a SharePoint List) but I got an error on the Dropdown box when it was in the form and tried to change the default property
Use the UpdateContext() function to set a variable that will store the new value of the dropdown box.
On the OnVisible property of the screen that contains the form:
UpdateContext({dropDownValue: "A"})
Default property of Dropdown1:
dropDownValue
OnSelect property of Button1:
UpdateContext({dropDownValue: "B"})
When you open the form, the dropdown box will show "A". When you click the button, the dropdown box will change to show "B".
If you have any questions or feedback, please let me know. Have a great day! 😊
-----------------------
PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻