cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver II
Resolver II

How to "Save as Draft" with required fields empty

We have a form that has a lot of fields( can be up to 100 depending on selections made), and many of those fields are required. There are times that when a user is entering a form they don't have all the required information.

My Submit button currently generates the correct error(s) if they don't fill-in all the required fields.

I'm looking for a way that if they haven't filled in all the required fields, they can save the form as a draft to return to later when they have all the information. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver II
Resolver II

Re: How to "Save as Draft" with required fields empty

As a Follow Up, the fields in SharePoint are not required, just on the App itself. I'm thinking out loud here so forgive me 😉

My Required fields are dependent on variables I set based on choices made in other fields.
If on the Form they choose "Add Vendor" or "Unblock Vendor" in the Request Type field then I set the variable to Yes:

If(ReqType.Selected.Value = "Vendor Add" Or ReqType.Selected.Value = "Unblock Vendor", Set(varVenAddUnblock,"Yes"), Set(varVenAddUnblock,""))
and the Cards have the Required setting to the following (Example Purchase card):

Purchasespendtype Card:   If(PurSpendType.Selected.Result = "-" && varVenAddUnblock = "Yes",true,false)

That part works and prevents the user from saving if true...

Wondering, and going to test now, if they click the "Save as Draft" button, it first set the VarVenAddUnblock variable to "" and then submits will that work to "Save as Draft".. .. Testing worked. for now.. 😉

View solution in original post

8 REPLIES 8
Highlighted
Super User
Super User

Re: How to "Save as Draft" with required fields empty

Hi @shanemeisner 

 

You can't leave required fields blank and still save it to the data source. You could leave a visual marker, like a star so the user knows the field is required, but then set the field to not required either in the app or in the data source.

 

---
Please hit the "Accept as Solution" button if my post answered your question! If my post was helpful please consider giving it a "Thumbs Up."

Highlighted
Resolver II
Resolver II

Re: How to "Save as Draft" with required fields empty

As a Follow Up, the fields in SharePoint are not required, just on the App itself. I'm thinking out loud here so forgive me 😉

My Required fields are dependent on variables I set based on choices made in other fields.
If on the Form they choose "Add Vendor" or "Unblock Vendor" in the Request Type field then I set the variable to Yes:

If(ReqType.Selected.Value = "Vendor Add" Or ReqType.Selected.Value = "Unblock Vendor", Set(varVenAddUnblock,"Yes"), Set(varVenAddUnblock,""))
and the Cards have the Required setting to the following (Example Purchase card):

Purchasespendtype Card:   If(PurSpendType.Selected.Result = "-" && varVenAddUnblock = "Yes",true,false)

That part works and prevents the user from saving if true...

Wondering, and going to test now, if they click the "Save as Draft" button, it first set the VarVenAddUnblock variable to "" and then submits will that work to "Save as Draft".. .. Testing worked. for now.. 😉

View solution in original post

Highlighted
Super User
Super User

Re: How to "Save as Draft" with required fields empty

The issue that you will have with this method is that once a user opens a saved draft, none of the previously stored variables will be in effect. You could try putting the variables into the OnStart property as well.

Highlighted
Resolver II
Resolver II

Re: How to "Save as Draft" with required fields empty

OK.. so I thought the same thing after reading your response.. But, so far, Testing shows differently.. I added a label to show me the value of the variable.

Here I am entering a new form, and you can see the Variable for Type of Request is "Yes" and the required fields are outlined in red:

Saveasdraft.png

I was able to click the "Save as Draft Button" and it saved without errors.
When I opened that form to view or edit, the Variable was Yes and the fields again are outlined in Red:

vardraftsave.png

and if I try to click "Save" I get the error I expected.

I am little baffled that it works, as the variable is set using the  "OnChange" for the "Type of Request" Field... so in theory what you stated should be correct, that the variable would be "Empty". after saving...

Highlighted
Super User
Super User

Re: How to "Save as Draft" with required fields empty

Did you close down the app and open it fresh?

Resolver II
Resolver II

Re: How to "Save as Draft" with required fields empty

I should preface this with..
I took over the build of this "App" from someone that left the company and they started it as a "Customized SharePoint Form" App, rather than a "true" Power App..

I did close out my browser, and did a Ctrl + F5 multiple times, as well as tried different browsers and the Variable is "Sticking".. 

I also asked another user to check the "Draft" item and they also see the variable as "Yes" and the required fields outlined in Red..

It's seems when the App loads, the "OnChange" is checked and seeing it as not the default value of "-" and thus setting the variable.

Highlighted
Super User
Super User

Re: How to "Save as Draft" with required fields empty

So is it doing what you wanted now? Users can submit a draft and come back to it later, with the required fields left unfilled now highlighted?

Highlighted
Resolver II
Resolver II

Re: How to "Save as Draft" with required fields empty

Yea.. I'm still not sure how.. hopefully it isn't a bug that will someday get fixed and break my Save as Draft.. But for now I'm going with it 🙂

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Come join us today! Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,156)