Skip to main content
Community site session details

Community site session details

Session Id : bsBouNgtaVr2aUrcPgu/Rv
Power Apps - Building Power Apps
Answered

save draft vs submit form button with some fields required.

Like (0) ShareShare
ReportReport
Posted on 27 Sep 2022 21:32:11 by 79

Hi all,

 

I have a form with Data cards set as Required = True, and a submit button that is visable if the form is valid (all cards filled). If the form was successfully completed, and the submit button clicked, I had SubmitForm(Form); Navigate(ScreenSuccess)

 

This worked fine.

 

I wanted to add a "save draft" option, I followed Rezas video on how to do this here https://www.youtube.com/watch?v=y24AkK-OXy0.

 

My problem is that when the Submit button is clicked, the form always navigates to ScreenSuccess and the user doesn't see the required fields messages.

 

I can't work out from Reza's video how to do the navigation - e.g. navigate to ScreenSuccess if saved as draft, and stop navigation if the form is not complete (e.g. hide the submit button or whatever).

Seems like it should be pretty basic and I'm missing something. How can I do this?

  • sossie07 Profile Picture
    79 on 27 Sep 2022 at 23:01:28
    Re: save draft vs submit form button with some fields required.

    Thanks for the responses, that is working.

     

    One other question if you could help....

    Previously I had the submit button displaymode set depending on all the Datacards being required and the form valid. But with Reza's example the the required property of each datacard is set depending on what button is clicked. Is there a way I can change the display mode of the submit button so its only in edit mode if the required fields are filled?

     

     

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 27 Sep 2022 at 22:34:25
    Re: save draft vs submit form button with some fields required.

    @sossie07 

    @Drrickryp is 100% correct!  You should have nothing but SubmitForm as your function.  Everything else should be handled in the OnSuccess or OnFailure actions of the form.

     

    To add though, in your case, you can simply look at whatever column you are storing your draft status in and then navigate if needed.

     

    Example formula in your OnSuccess action:

    If(
     !(Self.LastSubmit.Status.Value="Draft"),
     Navigate(yourScreen)
    )

     This would navigate if the status is NOT Draft.

     

    I hope this is helpful for you.

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on 27 Sep 2022 at 22:13:27
    Re: save draft vs submit form button with some fields required.

    @sossie07 

    There should never be anything chained after SubmitForm() for the reasons you gave for the problem you are having.  Any further commands should be put in the OnSuccess property of the form being submitted so that they are not executed unless the form is successfully submitted.  

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!