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.
Solved! Go to Solution.
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! |
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.
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,
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! |
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! |
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! |
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
182 | |
47 | |
46 | |
34 | |
33 |
User | Count |
---|---|
260 | |
87 | |
79 | |
68 | |
67 |