Hello,
I'm pretty sure this is actually a bug report - but not sure where I post them?
We operate a multi-tenant organisation. I'm building a Power App (Canvas App) that sits in an environment on a tenant where the majority of users are synced in as External Members.
The UPN of external members contains a couple of characters that are not URL safe. E.g. username_domain.com#ext#@tenantname.onmicrosoft.com
If I use this method to look up a user by their UPN directly...
Office365Users.UserProfileV2("username_domain.com#ext#@tenantname.onmicrosoft.com") - then it works as expected.
However, most usually, we don't start with a UPN. I'll instead have something like an email address from the "Created by" column in a SharePoint List. If I look up a user by their email address, e.g. ...
Office365Users.UserProfileV2("username@domain.com") - then it fails.
The error message suggests that what is happening is that the email address is being looked up, and resolved to a UPN. The UPN is then being looked up to fetch the user's profile data, but the UPN is not being encoded, and therefore truncated at the first "#" character.
{"error":{"code":"Request_ResourceNotFound","message":"Resource 'username_domain.com' does not exist or one of its queried reference-property objects are not present." .... }}
Or, that's very much what it looks like. Note that the error message includes the UPN up to the point of the first character that is not URL safe.
We've found this problem loads of times in SharePoint (e.g. the out-the-box Organisational Chart webpart doesn't work in this scenario because of the same issue).
Can anyone verify this, and suggest who I should contact, in this instance, to get Office365Users.UserProfileV2 fixed?
Thanks,
Steve.