Save as draft and Submit with required, optional functionality and by default required functionality in PowerApps

Introduction

This is the most required feature in any app. If the form is lengthier, it is a very useful feature. Any user can fill in half of the forms and save the form as a draft. Later can come in and pick up the form from where they left.

Scenario

We will see save as draft and save functionality in the form with the required property. We will also show how to make the required fields mandatory by default.

Objective

The objective of this requirement is very demanding as it is often required to save the form halfway through. So the Save as Draft feature is handy in day-to-day scenarios.

Step 1. The gallery is for validation and representation purposes.

In this article, we shall focus on button and form functionality. I have built a gallery to show variable values in terms of the required validation. We are seeing an arrow click where it navigates.

Gallery

Step 2. New Button.

Our list structure could be of any type. We shall only see button features and form functionalities. So, here we shall watch on the button to open a new form on what code should be written.

New button

Step 3. Design a New Form with our required button.

In form design, we will see button functionality, the form details will be seen later.

Required button

Step 4. Set Variable on Save as Draft.

Set Variable

Step 5. Set Variable on Submit.

Set Variable on Submit

Step 6. Make a few fields mandatory for Save as draft also.

Fields that will be mandatory in all scenarios will be set as true by default.

Make few fields

Step 7. Set the Required property formula.

Set a required property on condition for those fields that need to be validated and made mandatory or optional depending upon saving as draft or submission.

Set the Required property

Step 8. OnSuccess property of Form to navigate depending upon the button value.

OnSuccess property

Screens

Output

Output

Required field

Conclusion

In the above example when we click on the save as draft button it will save the form without filling the field values because they are not required. When we click on submit button all the required columns have to be filled.


Similar Articles