cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

How do you update a Multi-Select Lookup field using PATCH and a Combobox

I have a Parent and Child list.


I created a Combo box tied to the Child list.


I want to save the selected values to the Parent list

I've tried:


Patch(ParentList, Defaults(ParentList), {Title: inputTitle.Text, childItem: ContactSelector.SelectedItems});


Error: Expecting a table value but of a different schema

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper I
Helper I

Patching a Multi-Lookup

    Patch(ParentList, Defaults(ParentList), 
        {
            Title: inputTitle.Text, 
            childItem: ForAll(ContactSelector.SelectedItems,{       
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id: ID, Value: Title }) } );

To update a lookup you need to use: {odata, id, value}

 

To dynamically get these values, I used a ForAll to look over my Combobox

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Concat Multiselect Listbox expression error

Hi @simkessy ,

 

First of all, please tell what is the column type of "childItem" column in parent list? What is the Items property of the "ContactSelector" combo box? Please explain with all the involved columns' column types.

 

From the error message, I guess that "childItem" column is a Choice column that has multiple values enabled? If so, please make sure that the options you selected from "ContactSelector" combo box are included in the options of this Choice column. 

 

Regards,

Mona

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Helper I
Helper I

Re: Concat Multiselect Listbox expression error

First of all, please tell what is the column type of "childItem" column in parent list?

 

It's a Lookup to ChildList

 

> From the error message, I guess that "childItem" column is a Choice column that has multiple values enabled?

 

No, it's a Lookup to Childlist. 

Highlighted
Helper I
Helper I

Patching a Multi-Lookup

    Patch(ParentList, Defaults(ParentList), 
        {
            Title: inputTitle.Text, 
            childItem: ForAll(ContactSelector.SelectedItems,{       
'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference", Id: ID, Value: Title }) } );

To update a lookup you need to use: {odata, id, value}

 

To dynamically get these values, I used a ForAll to look over my Combobox

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,703)