I'm currently using a Compose action with:
union(body('Select'), body('Select'))
... that this isn't creating an AssignedTo array?
If AssignedTo is a multi person column, the value is an array of person objects.
Such an array has a structure like this (with some additional object properties):
[
{
"DisplayName": "Smith, Jim",
"Email": "jim@example.com"
},
{
"DisplayName": "Jones, Jane",
"Email": "jane@example.com"
}
]
Your union() function will return an array of distinct combinations of these persons.
With my example data, your expression would return an array of objects like this: [[Jim, Jane], [Jim]].
But you probably want just [Jim, Jane]
That's what the following expression does (the input of my "Apply to each" and for distinction I just use the Email property):
union(
xpath(
xml(json(concat('{"Root":{"Item":',body('Compose-Get_items'),'}}'))),
'//AssignedTo/Email/text()'
),
json('[]')
)
For the Compose - Get Item action, I'm unsure what the input should be in the Parameters tab.
This Compose is just the return value of your "Get items", probably this:
For testing my proposal, you should just create a Compose with the name "Compose-Get items" and add the vaslue above.
If this works, you can think about changing my expressions to directly address the original "Get items" action.
For the Send an email (v2) action, what should I add to the To: field to ensure everyone receives the email?
If you place the "Send an email" action in the "Apply to each" loop, the "To" field should be the following (as mentioned in my post):