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

Patch and Submit new form - Submit not working

I have a form where I am having to patch a dropdown value to a SP list and want to do this at the same time that the form is created and the other fields are submitted. I've tried with the Patch function. I can get the patched field to submit and create the record, but the other fields are empty. Below is my formula.

 

Patch('Alarm Tracking', Defaults('Alarm Tracking'), {Facility:DataCardValue12.Selected.Result}; EditForm1.Updates)

 

'Alarm Tracking' is the SP list where the new record should be created and the Facility field should be patched.  Any help would be appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Patch and Submit new form - Submit not working

Hi,

 

You will need to provide values for all of the other items, so you will need to do a LookUp, set the values to a variable, then patch those looked up values along with your Facility item.

 

Either that, or don't have it submit and instead collect all the data that you want to patch, and do just one patch action with all of your items instead of a submit, then reset your forms afterwards.

 

Cheers,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

11 REPLIES 11
Highlighted
Impactful Individual
Impactful Individual

Re: Patch and Submit new form - Submit not working

Hi @ahhollan 

It looks like you just have the ) in the wrong place. Move it from EditForm1.Updates) to just after the } in your Patch function

 

---
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
Helper IV
Helper IV

Re: Patch and Submit new form - Submit not working

Just tested that and it still only populates the Facility field in the new record. All others are blank.

Highlighted
Community Support
Community Support

Re: Patch and Submit new form - Submit not working

Hi @ahhollan ,

Do you want to create a new record by using a form and a drop down?
Please try this formula:

Patch('Alarm Tracking', Defaults('Alarm Tracking'), {Facility:DataCardValue12.Selected.Result},EditForm1.Updates)

If you use ";", data in the form will be overwrite with blank value. That's the reason why you meet this problem.

 

 

Best regards, 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Super User
Super User

Re: Patch and Submit new form - Submit not working

Hi,

 

You will need to provide values for all of the other items, so you will need to do a LookUp, set the values to a variable, then patch those looked up values along with your Facility item.

 

Either that, or don't have it submit and instead collect all the data that you want to patch, and do just one patch action with all of your items instead of a submit, then reset your forms afterwards.

 

Cheers,

Sancho


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


View solution in original post

Highlighted
Helper IV
Helper IV

Re: Patch and Submit new form - Submit not working

So how would that look if I chose to create a collection then patch? Is it all one formula in the OnSelect function of the button?

Highlighted
Helper IV
Helper IV

Re: Patch and Submit new form - Submit not working

I made the changes to the formula. Now it won't even submit, but it's not giving me any error.

Highlighted
Super User
Super User

Re: Patch and Submit new form - Submit not working

Hi,

 

Could you please provide the formula you are now using? and which option did you go for? Patching the whole thing after submit (I thought this would create two items though), or just doing the patch with all of the datacardvalue items from the form?

 

Thanks,

ManCat


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Highlighted
Helper IV
Helper IV

Re: Patch and Submit new form - Submit not working

formula.jpg

 

Highlighted
Super User
Super User

Re: Patch and Submit new form - Submit not working

Hi @ahhollan

 

Thanks for sharing that - have you tried testing by removing the additional items one by one to see if any of them is causing it to not patch the new row?

 

Kind Regards,

ManCat


@iAm_ManCat

Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you!


Thanks!
You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy
Sancho Harker, MVP


Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,537)