An array that looks like this is the output of a select operation on the properties of a SharePoint library.
[
{
"Reviewer": "user.1@school.edu",
"Filename": "file1.docx",
"Reviewdue": "2021-11-17"
},
{
"Reviewer": "user.1@school.edu",
"Filename": "file2.docx",
"Reviewdue": "2021-11-17"
},
{
"Reviewer": "user.2@school.edu",
"Filename": "file 3.docx",
"Reviewdue": "2021-11-17"
}
]
The array is the output of Select that has been sorted and stored in an array called sorted. Sorted has a length of 148.
An array variable called uniqueEmails is a union of the "Reviewer" item from the output of Select, producing a list of unique emails. uniqueEmails has a length of 20.
union(body('Select_emails'),body('Select_emails'))
Now, I need to make a HTML table for user.1 showing the 2 Filename and Reviewdue entries.
(Then the HTML table will go into an email addressed to the Reviewer address.)
Then, I want to make a HTML table for user.2 showing the 1 Filename and Reviewdue.
And so on sending an email and then looping through the list of uniqueEmails until the end.

Item is
item()
Reviewer is
body('Select_emails')?['Reviewer']
Please help. This runs indefinitely and never finishes.
Thanks,
Anne