Hi All,
Trying to set a variable when a drop-down value is equal to no I have the below on the drop downs "OnSelect" the drop down itself is also a variable "var_dropdown"
If(dropdown.SelectedText = "No"),Set(var_output , "TEXT")
Any suggestions would be greatly appreciated
Thank you so much, that worked perfectly
Hello @Mclean2023 ,
Here is the tested code for the onChange property of Dropdown box.
Please let me know if it works.
need to make small update on this, need another option. When i update the formula, I don't get an error, but nothing happens when running it. the first part still works by adding no but if I change the drop down to yes, the no stays in the field.
If(dropdown.SelectedText.Value = "No",Set(var_output , "TEXT_1") ||
If(dropdown.SelectedText.Value = "Yes",Set(var_output , "TEXT_2") ||
If(dropdown.SelectedText.Value="N/A",Set(var_output ,Blank())))
Hi , @Mclean2023
Yes , you need to put this code to "OnChange" property which means Actions to perform when the user changes the value of a control (for example, by adjusting a slider).
Drop down control in Power Apps - Power Apps | Microsoft Learn
If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance!
Best Regards,
Yueyun Zhang
HI Yueyun
PERFECT, thank you so much for your help and quick reply,
If(dropdown.SelectedText.Value = "No",Set(var_output , "TEXT") ) worked. once i moved it to "on change" and not "on select"
Hi , @Mclean2023
You can try to use this code:
If(dropdown.SelectedText.Value = "No",Set(var_output , "TEXT") )
The ".Value" is the column Name in your dropdown control - items columnName;For example , if my items column Name is "Col1", i need to use this expression:
If(dropdown.SelectedText.Col1= "No",Set(var_output , "TEXT") )
If this reply can help you , you can click mark this reply as solution (Accept solution) which can help more people, thanks in advance!
Best Regards,
Yueyun Zhang
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.