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

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (70,877)