cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JaredKing
Advocate II
Advocate II

ForAll patch error

 

Hi, trying to submit this code returns an error for line 5 (and line 7). If i change out Title for a string eg Title="1234" it works as expected. I have tried creating a new column so it isnt Title=Title 😉 but same error. Can anyone give me a hint as to what im doing wrong 😛

 

The intent is to check if a record exists and either patch or create new, so if theres a better way please let me know 🙂error.png

 

Full code:

 

ForAll(LocalFormQueue,
	Patch(
		Form,
		If(
			IsBlank(Lookup(Form,Title=Title)),
			Defaults(Form),
			LookUp(Form,Title=Title)		
		),
		{
			Title: Title,
			Shift:{
				'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                Id:Shift.Id,
                Value:Shift.Value
            },
			Department:{
				'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                Id:Department.Id,
                Value:Department.Value
            },
			Site:{
				'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                Id:Site.Id,
                Value:Site.Value
            },
			CriticalRisk:{
				'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
                Id:CriticalRisk.Id,
                Value:CriticalRisk.Value
            },
			InspectedDate:InspectedDate,
			NotesHRTD:NotesHRTD,
			NotesCR:NotesCR,
			NotesTB:NotesTB,
			InspectedBy:SPUser
		}
	)
)

 

1 ACCEPTED SOLUTION

Accepted Solutions
JaredKing
Advocate II
Advocate II

I solved it, changed the variable name on the RHS and it works. 

View solution in original post

1 REPLY 1
JaredKing
Advocate II
Advocate II

I solved it, changed the variable name on the RHS and it works. 

View solution in original post

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 Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,145)