cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
galdezanni
Advocate II
Advocate II

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}}))

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,438)