While updating an item in a list/library, we need to specify values
for all or at the least mandatory fields.
However, specifying values
for PeoplePicker fields, that too with Multiple selection becomes a tedious
job. More so as the values to be selected in 'Apply To Each' loop are not
directly available in the Dynamic content option.
To demonstrate an easy way to achieve this, I will start with a list - 'Department Details' with some regular columns like - DeptName, Address, and a PeoplePicker column named Associates.
Initialize an Array variable – AssociatesArray
Add a new action – ‘Apply to each’, and in ‘Select an output from previous step’, select ‘Associates’ array field as shown below -
It should be - triggerBody()?['Associates']
Add a ‘Compose’ action inside this ‘Apply to each’ loop, and add an
array structure and ‘Claims’ value for the Associates field, as shown below:
The value should be - items('Appy_to_each')['Claims'] when you hover over it.
Insert a condition to check if Address 1 is not empty.
If Yes, then add ‘Update Item’ action, and specify all
mandatory fields.
For Associates field, the Flow provides an option to manually enter
the multiple person values.
However, we are going to use the array we created in previous step.
Click on ‘Switch to input entire array’ as shown below –
I hope this post was
helpful. For any other queries, please post comments.
I thank you for
reading and look forward to seeing you on my blog next week!