Hi All,
The form submits to a SharePoint list ("Requests") which includes a Lookup column named Sub_Application. This column has the following properties set:
The initial screen contains a multi-select ComboBox control (cboPasaReqSubApp) that pulls values from the "Ref_Sub_Applications" list, with the Title column as the Display Value.
If the user selects multiple values from this ComboBox, all of those values should be listed in the aforementioned Lookup column (Sub_Application) once the form has been submitted.
The problem I'm running into is that regardless of the # of selections made from this ComboBox, the Sub_Application Lookup column is only reflecting the last selection that was made upon submission of the form.
When the user proceeds to the next (and final) screen, I'm using the below to create a collection for the selected records from the ComboBox:
ForAll(
cboPasaReqSubApp.SelectedItems,
Collect(
colSelectedSubApps,
{
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: cboPasaReqSubApp.Selected.ID,
Value: cboPasaReqSubApp.Selected.Title
}
)
)
When I view the collection (colSelectedSubApps), it's essentially showing duplicate values. For example, if the user selects two records from the ComboBox whose respective "Id" values are 4 and 7, the collection shows two records - but both records have the same Id and Value (representing whichever item was selected last from the ComboBox).
I'm not entirely sure where I'm going astray, so any help would be appreciated 😞
Thanks!
Solved! Go to Solution.
Hello @bcanfield83 ,
You made a typo in your "ForAll()".
Basically, you can access the read record inside the "ForAll()" loop with "ThisRecord". However, you're using "cboPasaReqSubApp", which tells the program for each item to reference the combobox instead of the read item.
Try replacing the "cboPasaReqSubApp.Selected" by "ThisRecord" and see how it goes.
Hello @bcanfield83 ,
You made a typo in your "ForAll()".
Basically, you can access the read record inside the "ForAll()" loop with "ThisRecord". However, you're using "cboPasaReqSubApp", which tells the program for each item to reference the combobox instead of the read item.
Try replacing the "cboPasaReqSubApp.Selected" by "ThisRecord" and see how it goes.
@WiZey - thank you, this looks to have resolved the issue! The collection is now reflecting the record(s) selected from cboPasaReqSubApp.
This is the updated formula that I'm using in the "OnChange" property of cboPasaReqSubApp:
ForAll(cboPasaReqSubApp.SelectedItems,
Collect(colSelectedSubApps,
{'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id: ThisRecord.ID,
Value: ThisRecord.Title
}))
For some reason, it's creating duplicate records, i.e.: when I selected two records from the ComboBox whose Id values are 5 and 7, it added a duplicate entry for the former (thus, there's 3 records in the collection even though I only selected two choices from cboPasaReqSubApp)
I can probably use the "Distinct" function to workaround that though.
User | Count |
---|---|
257 | |
108 | |
93 | |
57 | |
40 |