I am creating a form which the data will get saved to a collection and i would like to disable the button until all the fields are filled in.
Here is what i have on the buttons displaymode:
If(Site_Drop.Selected.Value = "Please select" && Start_Drop.Selected.Value = "Please select" && End_Drop.Selected.Value = "Please select" && Recurring_Drop.Selected.Value = "Please select" && IsBlank(Dept_Text.Text) && IsBlank(Number_Text.Text) ,Disabled, Edit)
If all the fields are empty then the button is disabled. But as soon as text is entered into 1 of the fields, the button is enabled regardless of the fact the other fields still need data.
The form consists of 4 dropdowns and 2 textinput fields. All the dropdowns have "Please select" as the first option, so if this is what is displayed then the button should be disabled.
Can anyone advise where i have gone wrong in my If statement please?
thanks in advance.
Alistair
Solved! Go to Solution.
Your statement reduces to disabled if all criteria are met. What that means is that if one of the criteria is false, then the entire statement is false and the button is enabled. What you need is for the button to be disabled unless all criteria are true. By replacing the && with || , I believe that the statement reduces to true if any of the conditions are true, then the button will be disabled.
If(Site_Drop.Selected.Value = "Please select" || Start_Drop.Selected.Value = "Please select"|| End_Drop.Selected.Value = "Please select" || Recurring_Drop.Selected.Value = "Please select" || IsBlank(Dept_Text.Text) || IsBlank(Number_Text.Text) ,Disabled, Edit)
Your statement reduces to disabled if all criteria are met. What that means is that if one of the criteria is false, then the entire statement is false and the button is enabled. What you need is for the button to be disabled unless all criteria are true. By replacing the && with || , I believe that the statement reduces to true if any of the conditions are true, then the button will be disabled.
If(Site_Drop.Selected.Value = "Please select" || Start_Drop.Selected.Value = "Please select"|| End_Drop.Selected.Value = "Please select" || Recurring_Drop.Selected.Value = "Please select" || IsBlank(Dept_Text.Text) || IsBlank(Number_Text.Text) ,Disabled, Edit)
Hi @Sibalukhulu
"||" is a shortcut for the OR condition. You can use as many as necessary to complete the logic of the IF() function.
Thank you it worked
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 |
---|---|
257 | |
122 | |
86 | |
73 | |
72 |