Hi,
I have an app where I fetch some information about a user based on a text field. My formula looks like this:
Office365Users.UserProfileV2(txtUserInitials&"@blahbalh.com").displayName
Even though it works and fetches the data as expected, it get this runtime error in the app:
Office365Users.UserProfileV2 failed: { "error": { "code": "ResourceNotFound", "message": "User not found", "innerError": { "date": "2020-11-12T08:00:32", "request-id": "XXXXXX", "client-request-id": "XXXXXX" } } }
Is there anyway I can avoid this error?
@NielsL It is throwing this runtime error because either you are passing blank txtUserInitials or wrong UPN/Email to UserProfileV2 function.
If you want to search the users then I will recommend you to use SearchUser() function instead of UserProfileV2().
Check below documentation for more information on SearchUser() function:
Additional reference: CREATE AN OFFICE 365 USERS LISTS AND SEARCH A USER
Please click Accept as solution if my answer helped you to solve your issue. This will help others to find the correct solution easily. If the answer was useful in other ways, please consider giving it ‌‌👍
Hi @NielsL,
Is txtUserInitials a variable ?
If so, based on your info, I think that this formula should get rid of the error:
If(IsBlank(txtUserInitials),"",Office365Users.UserProfileV2(txtUserInitials&"@blahbalh.com").displayName)
Hope it helps !
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 1