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.
Solved! Go to Solution.
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}}))
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
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
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}}))
User | Count |
---|---|
253 | |
109 | |
92 | |
48 | |
37 |