Trying to create a validation tool for multiple datasets, against our O365/AzureAD Values.
I found this bit of code
First(Office365Users.UserProfile((ThisItem.UserPrincipalName)).BusinessPhones).Value
Which can be used to dynamically show a phone number for the users that show up via text input search to a gallery.
I continue to recieve the following error though:
Office365.Users.UserProfile Failed: { "Status": 404, "Message": No user Found with the Specified id.r/nclientrequestid: (An ID number of some sort) "Source": "office365users-pa-usgv.azurewebsites.us" }
The code works but it prevents the app from being used outside of Edit mode (Which it works fine in, and shows the correct phone number for people), if i attempt to run the app the gallery wont load.
Try changing your formula to the following:
First(Office365Users.UserProfile(ThisItem.UserPrincipalName).BusinessPhones).Value
This may or may not be the issue, but the double parenthesis you had before around the UserPrincipalName...I've seen that be evaluate to "true" rather than the actual value you want. It's possible that is what is happening.
Let's start there...
Sorry! That was a typo when i wrote it out here, it does not have that in the code I am using.
Error remains the same.
Here's another version using the v2 user profile, which gives a different error
First(Office365Users.UserProfileV2(ThisItem.UserPrincipalName).businessPhones).Value
O365.Users.UserProfileV2 failed: {"error": {"code": "Request_BadRequest", "message": "Bad Request - Error in query syntax." "inner error"
I'm not seeing an issue with the formula then. It works fine here (edit and play mode).
The only difference is that I am testing against a hard coded email address instead of a list.
So,
1) perhaps roll back a stage and look at your Items property for the Gallery that this is coming from.
2) change the .UserPrincipalName to .mail to see if there are any changes (usually that is backward from what is normal - but worth a try)
3) Try to change your formula to Concat(Office365Users.UserProfileV2(ThisItem.UserPrincipalName), businessPhones & ",") this will combine any values in the businessPhones table into one string.
Hi @jtepp
same issue for me
I've tried with this formula, seems better 🙂
First(Office365Users.SearchUser({searchTerm:Authir.DisplayName})).TelephoneNumber
Or maybe you can manager this with a Flow..
Hi @jtepp ,
It seems like the error is because some of the users are not part of your tenant (most likely guest user or external contacts on office365).
To test this:
Try adding your email address: No Error
First(Office365Users.UserProfile(("Your email address")).BusinessPhones).Value
Try adding an email address of a Guest user from admin portal > users > Guest Users: Error
First(Office365Users.UserProfile(("Guest Users Email Address")).BusinessPhones).Value
----------------------------------------------------------------------------
Thanks,
K-A-R-L
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.
User | Count |
---|---|
151 | |
94 | |
85 | |
77 | |
58 |
User | Count |
---|---|
193 | |
175 | |
105 | |
96 | |
90 |