cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

Building Forms: MS Forms vs PowerApps

I'd like for my next project, that requires a form, to user PowerApps instead of MS Forms.  I'd like to be able to have each screen to be a different section of the form.  Patch was said to be useful OnSubmit.  I guess my question is, how can you Patch a record that does not yet exist? 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@duncant 

It really depends on how you are doing your app.  If you are using an EditForm, then you don't need to do Patches at all.  If you are building the "form" yourself, then you can do it screen by screen or on the last screen.  All controls in PowerApps are global, so you can reference values from anywhere.

Also, if you are considering splitting EditForms across multiple screens, you might be interested in my recent video on how to split forms across multiple screen.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

6 REPLIES 6
Super User III
Super User III

@duncant 

If the record does not exist, then you create it...

   Patch(yourList, Defaults(yourList), {<items...})

will create a record.  

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!
Super User III
Super User III

Hi @duncant 

It's possible to create a new record by combining the Defaults and Patch functions.

There are more details in the documentation here:
https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-patch

The example syntax to create a record looks like this:

Patch(
       YourDataSource,
       Defaults(YourDataSource),
       {FieldName: "value"}
)

 

Helper IV
Helper IV

Would the patch need to be done on the final screen that will be used to submit the data?  Or will the Patch need be done on each screen?

Super User III
Super User III

@duncant 

It really depends on how you are doing your app.  If you are using an EditForm, then you don't need to do Patches at all.  If you are building the "form" yourself, then you can do it screen by screen or on the last screen.  All controls in PowerApps are global, so you can reference values from anywhere.

Also, if you are considering splitting EditForms across multiple screens, you might be interested in my recent video on how to split forms across multiple screen.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Helper IV
Helper IV

Thank you. I'm build the form   New Mode.  I'd like ensure that each screen is validated before moving the next screen. 

Super User III
Super User III

@duncant 

The EditForm will do basic validations.  There is a Valid property on the form that will let you know if it is valid or not.  Validation is basic (required fields are completed).

Of interest to you as well would be my video on EditForms - everything you want to know.  Particularly Part 1 where all the form properties and controls are examined.  

If you need more complex validation, you can also take a look at my Input Form Validation video.  It discusses more complex validation on EditForms and custom built forms as well.

I hope they are helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

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