cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jarrystowe
Helper II
Helper II

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
Helper II
Helper II

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
Helper II
Helper II

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (18,906)