Hi @johnjohn123,
You could collect this logic from the claims value. Below is an example of an Approvers array which contains three person or group objects (user, sp group and O365 group).
"Approvers": [
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "i:0#.f|membership|jane@contoso.onmicrosoft.com",
"DisplayName": "Jane Doe",
"Email": "jane@contoso.onmicrosoft.com",
"Picture": "",
"Department": "Sales",
"JobTitle": "Account Manager"
},
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "c:0o.c|federateddirectoryclaimprovider|randomguid",
"DisplayName": "806590 Members",
"Email": "806590@contoso.onmicrosoft.com",
"Picture": "",
"Department": null,
"JobTitle": null
},
{
"@odata.type": "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
"Claims": "c:0o.c|federateddirectoryclaimprovider|randomguid",
"DisplayName": "Office 365 Group",
"Email": "Office365Group@contoso.onmicrosoft.com",
"Picture": "",
"Department": null,
"JobTitle": null
}
]
As you can see the difference is the first part of the Claims value. So you could use that to determine if it is a user by using an expression and the startswith function. If the output of that expression is true you will know it is an user.
Below is an example of that expression for this check within an apply to each.
startswith(items('Apply_to_each')?['Claims'], 'i:0#.f|membership|')