I have a flow that triggers when a new email is received in a shared mailbox. The flow uses the email address in the TO field to lookup the user profile and get the Department associated with the user the email was sent to to write that along with some other info to a SharePoint list. The flow works fine when there's only one person in the TO field. It fails when there's more than one person.
How can I get the Flow to loop through each email address in the TO field to create a new row in the SharePoint list?