I have an excel spreadsheet table that feeds my dropdown box values in Powerapps. I left an empty cell so that I can have an empty value as the first selection in my dropdown box.
I need to disable the submit button if the empty value is selected. I don't want the user to submit the form if the empty value is selected. I figured out how to disable the button for the "traffic" value but I do not know the name of that empty value to make my formula work. See screen shots.
Please help 🙂
If((Reasons_DD).Selected.Value = "Traffic",DisplayMode.Disabled,DisplayMode.Edit)
Solved! Go to Solution.
I have a similar problem to the original post, I've followed you're instructions but I cant seem to get mine to work!
I have a radio button with "Pass" or "Fail".
If "Fail" gets selected, it brings up a Comments Box, a dropdown list & a "send email notification" button as shown below.
The If statement I have used for these boxes to appear is if fail is selected is..
If("fail" in Radio5_33.Selected.Value, true) ...which works fine.
However in the 'Assigned To dropdown', I have an option of "N/A".
If N/A is selected, I want the 'Send Email Notification' button to either be hidden or be disabled so it is unable to be pressed. Do you know what formula I need to use to get this to work please?
@JD2301Assuming your dropdown is named 'Assigned To dropdown' and that you want the button to be disabled when "N/A" is selected, you would use the following code in the DisplayMode property of your button:
// Disable button if "N/A" is selected If( 'Assigned To dropdown'.Selected.Value = "N/A", DisplayMode.Disabled, DisplayMode.Edit )
I noticed that your dropdown was blank in the picture, so if you want to incorporate that into the mix, the following should work (again in the DisplayMode property of your button):
// Disable button if dropdown is blank or "N/A" is selected
If( Or(IsBlank('Assigned To dropdown'.Selected.Value), 'Assigned To dropdown'.Selected.Value = "N/A"), DisplayMode.Disabled, DisplayMode.Edit )
If you instead want to make the button invisible, you would replace DisplayMode.Disabled with false and DisplayMode.Edit with true and put the formula in the Visible property of the button. You could also mix and match a bit, like if you want the button invisible when a blank value is in the dropdown but disabled when "N/A" is selected, but I digress.
Let me know if that works for you. Otherwise, let me know and I'll be happy to help out until it does!
*edit for comment in second code snippet*
That is perfect thank you.
I've set the button to be disabled if "Not Applicable" is selcted and I have changed the blank column to state "Please Select from List" and also managed to make the button disabled if this is chosen using the formula:
If(Dropdown6.Selected.Value = "Not Applicable", DisplayMode.Disabled, If(Dropdown6.Selected.Value = "Please Select From List", DisplayMode.Disabled))
Thanks for your help.
@JD2301Awesome work! A couple suggestions about your code: it may be easier to read and change later if you use an Or statement instead of nesting If statements, especially because they have the same result. Something like:
// Disable button if "Not Applicable" or "Please Select From List" is selected If( Or(Dropdown6.Selected.Value = "Not Applicable", Dropdown6.Selected.Value = "Please Select From List"), DisplayMode.Disabled, DisplayMode.Edit )
Also, you may test that your code works when selecting values other than "Not Applicable" and "Please Select From List" due to not explicitly having DisplayMode.Edit in there. It may not work properly. You may need to have something like (my addition to your code in bold):
Dropdown6.Selected.Value = "Not Applicable",
Dropdown6.Selected.Value = "Please Select From List",
That stuff aside, I am happy you were able to get it working!
Check out our new profile badges recognizing authored solutions!
We are excited to announce the Power Apps Super Users!
Did you miss the call? Check out the Power Apps Community Call here.
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!