Hi all, Can anyone see what I am doing incorrectly here? I have the following code:
With(
{
existingBooking: First(colExistingCardBookings)
},
If(CountRows(locAvailableCards) = 0,
UpdateContext({locExtendDateError: "Error message here"}),
//Otherwise assign the first Available card to the existing booking
Patch('Card Booking Requests', existingBooking,
{Card:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:First(locAvailableCards).ID,
Value:First(locAvailableCards).'Reference Number'}
}
)
)
)
What I am trying to do is the following:
I have two SharePoint lists, one for cards and one for bookings. The Bookings list has a lookup column to allow association of a card to a booking.
In the code above I need to assign a new value to the Card column for an existing Booking record if there is one in the Available Cards list.
However I keep getting the following error:

I'm pretty sure it's the Patch call, as if I replace the Patch call with empty quotes the error disappears, but I can't for the life of me see what is wrong with the Patch call.