My goal is to update the Provider list with all the unique values from a corresponding column in a Staff list. So, if a provider has 10 staff and uniquely, they have 20 credentials, I want to update the provider list showing all the unique values of their 10 staff -- showing the 20 credentials.
I have a SharePoint provider list and a SharePoint staff list. The staff list has a lookup column to the Provider List. I would like to update a column in the Provider list based on unique values rolled up from the staff list. So, there needs to be an apply to each loop in order to get all the values from the staff, union them to get the unique values and then take that array and update the provider list.
Within the apply to each (parsing through the staff), I have...
A select statement that parses out the multi-select column from all staff assigned to the provider. (gets all service arrays)
A compose statement that does a union with the output from the previous select and the variable array. (varServiceArray) -- this is what I was hoping would append what is found with the next staff, appending to what was already assigned from all previous staff)
A set variable statement that is the outcome of the union compose.
Outside the apply to each, I have a compose statement that is merely the variable (varServiceArray) in the set within the apply to each.
Next is the update to the SharePoint list where I use the compose statement that is the total array.
The variable is then reset.
This is not working! The UNION step (what is found from the current staff and unions with the variable -- in hopes to continue appending all staff's details) is wrong.
What I am hoping for is to find a provider, get all staff assigned to the provider, append all service arrays assigned to all staff, get unique values, then update the provider with the unique values of all staff assigned to them.
Any suggestions?


Report
All responses (
Answers (