I've built a custom "form" on a blank, scrolling screen. I've added all of the inputs and labels myself, connected a couple of different data sources and I am patching the data to a list OnClick of a "Submit" button. I cannot for the life of me figure out how to make these fields required. There are 49 different inputs on the form and I need to make about 30 of them "Required" and not allow the app to patch the data to the list unless they have filled out all the required fields. All I can find is information about how to do this with the click of a button when using an Edit Form but this property is not available for any of my inputs. Thank you in advance for any direction you can give!
@wyotim It's been a while, how have you been? Finally getting back to the swing of things myself and thought you might have some insight into this one, as you seemed to always know what to do when it comes to PowerApps.😁 Either way, I hope you and your family are staying safe!
I would do it like if(IsBlank(field1)||IsBlank(field2)||IsBlank(field3),Disabled, Edit) in the display mode property of the button. This will prevent selecting the button if any of them are null.
and btw that is way too many required fields. Every UX study shows that the more fields are required, the less likely users will be to complete the form
You can do it the way @jlindstrom suggests, but I find that really cumbersome if there are a lot of fields. Instead I create an integer variable Then in each required field's OnChange event I increment the number if its filled in and decrement the number if its empty. Then use a simpler IF() in the submit button that disables it until the count is greater than the number of required fields.
You are right @Pstork1 , that is much better unless you want to type a lot of field names.
a form with 40 + required fields gives me nightmares
another thing I’ve observed: users are generally lazy and if you require more than 10-15 fields you are preventing users from doing their job if they don’t have some of the information. So what does the smart user do? They start making up crap. I can’t tell you how many times I’ve seen people require email address only to find users enter email@example.com in the email field just because they don’t have it but their app requires them to enter something to finish their job
These are both great solutions and exactly what I was looking for. Thank you both for your help. Also, that is something I never knew regarding the fact that users are less likely to fill out a form the more required fields there are. Unfortunately, this is a contract related form and the business was very clear that nearly every field needs to be required (minus the checkboxes). Both of these solutions seem great. I probably won't get to implementing either of them tonight but this gives me peace of mind knowing that a solution is available and I won't stress over it all weekend. Thanks again to both of you.
@CarlHRVA So in that case you should have a contract status field and allow users to save the contract as draft status without having all values, but not let them change the status to the final status until all fields have been filled out. That way they can start to create the contract without having all of the information then come back and finish it. Nothing would be more frustrating than to fill out 28 fields then realize you don’t have one piece of information and have to start all the way over
I completely agree that many users will not use a form where almost everything is required.
One thing you could also consider is to have something to denote a 'required but empty' type status, like having the required fields have a red border if they are empty and the standard colored border if they are filled. Employing a similar logic to @jlindstrom's but individually to the border color would do the trick. It sounds like a mammoth form, so another thing you could do is separate it into "pages" by making some elements visible and when the user clicks a "next" button (which could have the same logic for being active only when all required fields are filled) it reveals the next set of fields. That might make it feel a bit more manageable to the user by having the suggested 10-15 fields per "page" and having them logically grouped so that they can have the right information gathered at each step in the process. This could be used in tandem with @jlindstrom's (awesome) draft suggestion as well by having some logic on the "next" button that saves progress, perhaps using the SaveData function or writing to a data source but having a "draft" designation until all required fields are filled, which would give it a "finalized" designation.
How have you been @CarlHRVA? I'm happy to see you here! I hope you and yours are staying safe and doing well! Things have been well on my end, though I am on the tail end of recovering from a broken collar bone and resulting surgery to repair it (0/10 do not recommend, though it gave me a funny story to tell about the dangers of playing tag 😁). Other than that bump in the road, my family and I have been doing well. Again, great to see you here, and best of luck with your form!
@wyotim Sorry to hear about your injury but glad to hear that you are on the mend! My family and I are staying safe and doing well, thank you.
As for the solutions, you guys are the best. This community is unbelievably helpful and I wouldn't know one-third of the stuff I know if it wasn't for everyone's help. I think I will take a bit from each of you. Although I can't do much about the business requirements and the fact that they want all fields to be required, I will implement @Pstork1's method for making them required, as well as @jlindstrom idea for allowing them to save it as a Draft and your recommendation about the required red border when empty for a really nice solution. Thank you all so much. I am sure that we will be talking much more again as things begin to pick back up. 🙂
Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.
Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.
Featuring samples like Return to the Workplace and Emergency Response Applications
Features releasing from October 2020 through March 2021