@Expiscornovus Following on from my previous issue (https://powerusers.microsoft.com/t5/Building-Flows/Search-for-job-title/m-p/1495842) where you helped me tremendously, now I am trying to get the email address from the resulting output. Instead it is returning a Null even though it can be seen clearly that it is extracting the email address.
In Send an HTTP request, this is the string:
https://graph.microsoft.com/v1.0/users/?$select=mail&$filter=jobTitle eq 'ACIO'
The Parse JSON step produces this output
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(mail)",
"value": [
{
"mail": "user@domain.edu"
}
]
}
Where user@domain.edu is actually the correct email address I want.
The Apply to each is
And Set variable is setting the value in
items('Apply_to_each_3')?['mail']
but this is coming up as Null.
Please help, what do I have to do to get the email address into the variable?
Thanks,
Anne
Thanks! I've got my version working using the apply each loop now. I had to add a couple of steps involving parsing JSON, it's not very sophisticated but it works. Your solution is more elegant than mine so I will try it later and report back with results.
Hi @annetoal,
I assume you are only expecting one result? If that is the case, a parse json and a loop would not be needed.
In that case an expression which retrieves the mail property value of the first item is sufficient.
Below is an example of that approach.
Use the set variable directly after the Send an HTTP request action and use this expression:
body('Send_an_HTTP_request:_ACIO')['value'][0]['mail']
Michael E. Gernaey
497
Super User 2025 Season 1
David_MA
436
Super User 2025 Season 1
Riyaz_riz11
244
Super User 2025 Season 1