Hello, we have a flow where the Get User Profile suddenly stopped working for some users.
To investigate the issue I created a small flow that shows the minimum needed for the issue. Here I have an action that searches for a UPN and then uses the returned user to try and get using the "Get User Profile (V2)".
I have tried with different users and it seems to work for some, and not for others.
Here is what happens:
- I trigger the flow manually
- A search is performed with the provided UPN, 1 matching user is found
- Get user profile (V2) is called with the "UserPrincipalName" from the "Search for users (V2)" but fails to find any users and returns "NotFound"
Expected behavior: If I try to use the action "Get user profile" with a UPN that I just read from the action "Search for users" I expect the other action to find the same user.
Added context that might be interesting:
If I try to hardcode a UPN that doesn't exist in the Get user profile, I get a different error from when I enter the known UPN from the search for user step. And with some UPNs, it works with the Get user profile.
This is the output I get with the malfunctioning user:
{
"error": {
"code": "-1, Microsoft.SharePoint.Client.ResourceNotFoundException",
"message": "Exception of type 'Microsoft.SharePoint.Client.ResourceNotFoundException' was thrown.",
"innerError": {
"date": "2024-11-23T18:06:39",
"request-id": "8e34f65a-939d-43de-986f-ce8c5b61a162",
"client-request-id": "8e34f65a-939d-43de-986f-ce8c5b61a162"
}
}
}
And this is the error I get when entering a known-nonexistent UPN:
{
"error": {
"code": "ResourceNotFound",
"message": "User not found",
"innerError": {
"date": "2024-11-23T18:12:20",
"request-id": "e821a1b7-d447-44b7-bb26-65f7f775c9b4",
"client-request-id": "e821a1b7-d447-44b7-bb26-65f7f775c9b4"
}
}
}
Hoping that I might be able to get some support from this community with what it is that I'm doing wrong. Thanks in advance 😊