cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Axal
Super User
Super User

Patch error : expected record

Hi guys,

 

While Patch, I face an error saying "the type of this argument "my field" does not with the expected type Record, found Number"

 

My data source is CDS, and the field that wants to insert is a lookup column. As the input column is based on the Edit form which has the Datacard, how would be the patch ?

 

I'm using something like this : 

Patch('Jobs',
Defaults('Jobs'),
{'Order': Value(DataCardValue3.Text),

....}

 

The DataCardValue3 is the name of the control in the edit form which is the field of my field : Order

 

Kindy help. 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

@Axal Your 'Order' column is a LookUp and you are sending it a number.

Assuming that DataCardValue3 is a dropdown, change the formula to,

'Order': DataCardValue3.Selected

View solution in original post

7 REPLIES 7
DylanSimons
Resolver III
Resolver III

Hello, you need to patch the entire record associated with the lookup column. Please see the link below, which describes it nicely.

 

https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-patch-a-SharePoint-Lookup-Column/td-p...

 

I have much more luck simply using an edit form and SubmitForm() to patch it even if the lookup column is the only field in the edit form.

CNT
Super User
Super User

@Axal could you share a screen shot of the entire formula along with the error message.

Hi @CNT 

 

This is it :

Axal_0-1626100735126.png

 

 

Hi @DylanSimons ,

Yes, however my datasource is CDS not Sharepoint, and unfortunately, I'm not a developer so I don't understand how to translate that to CDS.

 

Thanks,

@Axal Your 'Order' column is a LookUp and you are sending it a number.

Assuming that DataCardValue3 is a dropdown, change the formula to,

'Order': DataCardValue3.Selected

@CNTis correct, that should work for the patch.

It works
Thank you both.

@Axal Glad to help!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,851)