web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Trouble With Patch Fun...
Power Apps
Unanswered

Trouble With Patch Function

(0) ShareShare
ReportReport
Posted on by

Hi, I'm having some trouble getting the patch function to work consistently in a particular part of my app. I've used patch many times before without issue, but now it's intermittently leaving fields blank. The fields that do not get updated with data are often, but not always, the same fields. I've confirmed that data in the source fields is present. I've attempted many different versions of the same code and all produce the same result. Hoping someone can see a glaring issue here.

 

This runs On Success of a form submission.

 

UpdateContext({ CurrentItem: Self.LastSubmit, editMode: false, newMode: false });
If(Or(Not(GUID(varJHAJob)=Form1_8.LastSubmit.'Job Order'.'Job Order'),newMode),
Set(varJHAJobsite,RecordsGallery1_10.Selected.'Job Order'.Site.Jobsite);
Patch(JHAs,Form1_8.LastSubmit,
{Site:Form1_8.LastSubmit.'Job Order'.Site,
'Hospital Name':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Hospital Name'),
'Hospital Phone':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Hospital Phone'),
'Hospital Directions':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Hospital Directions'),
'Hospital Address':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Hospital Address'),
'Police Department Name':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Police Name'),
'Police Department Phone':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Police Phone'),
'Police Department Address':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Police Address'),
'Fire Department Name':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Fire Name'),
'Fire Department Phone':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Fire Phone'),
'Fire Department Address':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Fire Address'),
'Ambulance Name':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Ambulance Name'),
'Ambulance Phone':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Ambulance Phone'),
'Ambulance Address':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Ambulance Address'),
'Job Number':Form1_8.LastSubmit.'Job Order'.'Job Number',
'Site Number':LookUp(Jobsites,Jobsite=GUID(varJHAJobsite),'Site Number')}));
Set(varJHAJob,"");
Set(varJHAJobsite,"");
Categories:
I have the same question (0)

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 836 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 231 Super User 2025 Season 2

Last 30 days Overall leaderboard