Hi there,
Hitting a real wall with this. I'm worried there's no way, but hopefully someone can help. I'm creating an employee directory using a basic gallery with a SharePoint list as a data source. I've gotten name, email, and department to display without issue for each item in the gallery. However, when I attempt to get the phone number showing as well, it doesn't seem possible.
Microsoft docs and every other tutorial on employee directories either assume you only want the current user's information, or they seem to imply that the Office365Users.UserProfile() function cannot work unless you type an email address in directly, but that wouldn't work at all for a gallery that's populating from SP. I consistently run into the "this formula doesn't support scope" no matter how I try to work around the issue. To be clear, this is the code I'm trying to use in the field I want to show the phone number:
Office365Users.UserProfileV2(ThisItem.Name.Email).businessPhones
It seems like it should work, the logic makes sense to me. Any help is greatly appreciated.
edit: just to clarify this is the guide I tried to follow by MSFT: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/connections/connection-office365-users
But it assumes one would be manually entering the UPN string into the function and not referencing it within a gallery.
final edit: @Jeff_Thorpe had the answer! I used this code in the Label's text property where I wanted the mobile number to show:
First(Office365Users.UserProfileV2(ThisItem.Name.Email).businessPhones).Value
This produced errors regarding not finding the user(s) but they are safe to ignore.