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

Announcements

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 529 Most Valuable Professional

#2
Haque Profile Picture

Haque 230

#3
Kalathiya Profile Picture

Kalathiya 217 Super User 2026 Season 1

Last 30 days Overall leaderboard