cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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), ValueSmiley Very Happyropdown1.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 Smiley Happy

 

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}})

 

 

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 Smiley Happy

 

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}})

 

 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, August 21st at 8am PDT

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

SixthImage

Power Summit Australia 2019

August 20-23rd 2019

Users Online
Currently online: 29 members 3,872 guests
Recent signins:
Please welcome our newest community members: