Apply to each Expression Evaluation Failed when building email string
Initialize varialbes: GroupID (int), strEmailRecipient (str)
Note the GroupID is used in the () to quesry the correct sitegroups and $select Email of all members. And the HTTP requests returns green.
How the 'Parse JSON' step is configured:
Which runs successfully during test:
Here is how the 'Apply to each' is configured to build a string of email addresses:
And the error message during test:
I've tried adding ?[0]?['Email'] and error becomes:
The execution of template action 'Apply_to_each' failed: the result of the evaluation of 'foreach' expression '@{body('Parse_JSON')?['d']?['results']}?[0]?['Email']' is of type 'String'. The result must be a valid array.
Same results when I add item()? before the email in the value 'Append to string variable'.
If only there was a step to query SPO groups for emails... but La..
Thanks in advance!