Is it possible to search for a user's email based on his job title? I'm using Search for users (V2). It works fine when you use the person's name, but searching for Director returns [].
Thanks,
Anne
After the step where you send the HTTP request to Sharepoint, parse the JSON of the output using this (I used the name Parse JSON for the connector, which you will see in the next step.)
{
"type": "object",
"properties": {
"d": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"uri": {
"type": "string"
},
"type": {
"type": "string"
}
}
},
"Alerts": {
"type": "object",
"properties": {
"__deferred": {
"type": "object",
"properties": {
"uri": {
"type": "string"
}
}
}
}
},
"Groups": {
"type": "object",
"properties": {
"__deferred": {
"type": "object",
"properties": {
"uri": {
"type": "string"
}
}
}
}
},
"Id": {
"type": "integer"
},
"IsHiddenInUI": {
"type": "boolean"
},
"LoginName": {
"type": "string"
},
"Title": {
"type": "string"
},
"PrincipalType": {
"type": "integer"
},
"Email": {
"type": "string"
},
"Expiration": {
"type": "string"
},
"IsEmailAuthenticationGuestUser": {
"type": "boolean"
},
"IsShareByEmailGuestUser": {
"type": "boolean"
},
"IsSiteAdmin": {
"type": "boolean"
},
"UserId": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"NameId": {
"type": "string"
},
"NameIdIssuer": {
"type": "string"
}
}
},
"UserPrincipalName": {
"type": "string"
}
}
}
}
}
It will expose the email address. Store the email address in a string variable using this expression
body('Parse_JSON')?['d']?['Email']
You can then insert this variable into the email connector you're using to send the mail.
Great solution.
Hi @annetoal,
In that case try the Send an HTTP request (preview) action from the Office 365 Groups connector. That one is still not premium 😁
The URI is slightly different compared to my previous example. I have added a forward slash between users and ?, because of an issue @VictorIvanidze found in this thread:
https://graph.microsoft.com/v1.0/users/?$select=userprincipalName,displayName,mail,jobTitle&$filter=jobTitle eq 'Director'
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2