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

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
iAm_ManCat
Super User II
Super User II

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
SeanHenderson
Impactful Individual
Impactful Individual

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."

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

v-yutliu-msft
Community Support
Community Support

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.
iAm_ManCat
Super User II
Super User II

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

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?

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

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


formula.jpg

 

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (77,453)