cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
simkessy
Level: Powered On

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
simkessy
Level: Powered On

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
Community Support Team
Community Support Team

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.
simkessy
Level: Powered On

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. 

simkessy
Level: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,481)