cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jarrystowe
Level: Powered On

Unable to Patch Look Up Column - A value must be provided for item.

Howdy,

 

I cannot get the Patch /odata.type to work even on an extremely simple table with a look up . . details below

 

Primary Table: testMain - No Required fields.

Fields

  1. whatever - Single line of text
  2. NameLookup - Lookup @ testingListValues
    1. Require: No
    2. Enforce unique: No
    3. Get information from: testingListValues
    4. In this column: "Name1" (Contains the values, maybe i need to use ID??)
    5. Enforce relationship behavior: unchecked
  3. ID - default...

List Table: testingListValues - No Required fields.

Fields

  1. Name1 - Single line of text
  2. ID - default...

Onto the power apps details

 

Gallery1

Items: testMain

 

Form1 (for ease of view... not used in patch)
DataSource: testMain
Item: Gallery1.Selected

 

Drop down outside of form (Attempt at ensuring I am not manually entering wrong)

Items: testingListValues

Value: Name1

 

Patch Button - patching into TestMain, the record is the selected gallery item, the updating is for the column NameLookup - and the Id/Value from the dropdown are 1/"Jarrett" respectively (The first row in the testingListValues)

 

Patch(testMain,
First(Filter(testMain,Gallery1.Selected.ID=ID)),{
NameLookup:{
'@odata.type':"#Microsoft.Azure.Connectors.Sharepoint.SPListExpandedReference", Id:Value(Dropdown1.Selected.ID), Value:Dropdown1.Selected.Value
}})

 

Have also used hardcoded as below...

 

Patch(testMain,
First(Filter(testMain,Gallery1.Selected.ID=ID)),{
NameLookup:{
'@odata.type':"#Microsoft.Azure.Connectors.Sharepoint.SPListExpandedReference", Id:1, Value:"Jarrett" }})

I always recieve error: The requested operation is invalid.  Server Response: A value must be provided for item.  clientRequestId: 698b986d-af9a-41dc-952c-2c0e92da4622

 

I've scoured every post on google and powerapps commnity - I can't see what I am doing wrong Man Sad

 

1 ACCEPTED SOLUTION

Accepted Solutions
jarrystowe
Level: Powered On

Re: Unable to Patch Look Up Column - A value must be provided for item.

Figured it out... the content of the @odata.type is very case sensitive 🙂

 

Was using 

"#Microsoft.Azure.Connectors.Sharepoint.SPListExpandedReference"

Should have been using

 

"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"

To contribute a bit... you can assign the above to a variable to make things simpler while typing

 

//First create a variable

Set(odataVar,"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference")

//Usage in patch

Patch(
    DataSource,
    First(Filter(DataSource,SelectedVariable.ID=ID)),
    { StatusLookUp: {
        '@odata.type' : odataVar,
        Value: "",
        Id: 1}})

 

 

View solution in original post

1 REPLY 1
jarrystowe
Level: Powered On

Re: Unable to Patch Look Up Column - A value must be provided for item.

Figured it out... the content of the @odata.type is very case sensitive 🙂

 

Was using 

"#Microsoft.Azure.Connectors.Sharepoint.SPListExpandedReference"

Should have been using

 

"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"

To contribute a bit... you can assign the above to a variable to make things simpler while typing

 

//First create a variable

Set(odataVar,"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference")

//Usage in patch

Patch(
    DataSource,
    First(Filter(DataSource,SelectedVariable.ID=ID)),
    { StatusLookUp: {
        '@odata.type' : odataVar,
        Value: "",
        Id: 1}})

 

 

View solution in original post

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,819)