cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
galdezanni
Helper III
Helper III

Save ComboBox Data to Sharepoint List - LookUp Type Column

Hi,

 

I have the following difficulty:

I have a list in Sharepoint (PlanList) that has a column (JurisdCol) with “LookUp” type, this column is related to another list (JurisdList).

 

In my app, I have a ComboBox (multiple selection) that brings data from the JurisdList list that would feed the PlanList list into the JurisdCol column.

I was able to get it to write this data, each in a different row, but I had to change the type of the “LookUp” column to “Single Line of Text” with this code:

 

ClearCollect (JurisSelected, ComboBox2.SelectedItems); ForAll (JurisSelected, Patch (PlanList, {JurisCol: JurisSelected [@Title]}))

 

I would like to know how to make this same data writing, but with a “LookUp” type column.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

 

It worked!!!

 

Thank you so much for your attention and willingness...

 

I used the following code:

 

ForAll(ComboBox1.SelectedItems; Patch(MatrizPlanejamentoList;{Jurisdicionado: {      
              '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
              Id: Id; 
              Value: Value}}))

 

 

View solution in original post

4 REPLIES 4
v-monli-msft
Community Support
Community Support

Hi @galdezanni ,

 

To use a combo box control to update Lookup column, you need to enable the "multiple select" option for the lookup column setting in SharePoint. Then you will see this column's data card inside an edit form is shown as a combo box by default. 

 

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.
v-monli-msft
Community Support
Community Support

Hi @galdezanni ,

 

If you insist to custom the combo box and use the source list as the data source of combo box, then the Patch formula should be something like:

JurisCol: ForAll(ComboBox2.SelectedItems,{       
              '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
              Id: ID, 
              Value: Title 
            })

 

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.

Hi,

 

Thank you for your answer!

 

I tried both options but it didn't work out.

 

Leaving the column type to allow multiple selection, and with the following code:

 

 

Patch(MatrizPlanejamentoList,{Jurisdicionado:  ForAll(ComboBox1.SelectedItems,{       
              '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
              Id: ComboBox1.Selected.Id, 
              Value: ComboBox1.Selected.Value
            })})


This way it created only one row and containing only the last selected item, however I had selected 4 items.

 

But, I wanted his to save the 4 items on the same row, or each different item and row, along with other text fields - all on the same row.

 

Jurisdictional Column: Lookup (allow multiple items)

Hi,

 

It worked!!!

 

Thank you so much for your attention and willingness...

 

I used the following code:

 

ForAll(ComboBox1.SelectedItems; Patch(MatrizPlanejamentoList;{Jurisdicionado: {      
              '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";
              Id: Id; 
              Value: Value}}))

 

 

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

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,351)