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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,943)