web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Office365Users URI error
Power Apps
Answered

Office365Users URI error

(0) ShareShare
ReportReport
Posted on by 46

Office365Users.UserPhotoMetadata failed: { "error": { "code": "BadRequest", "message": "The request URI is not valid. Since the segment 'users' refers to a collection, this must be the last segment in the request URI or it must be followed by an function or action that can be bound to it otherwise all intermediate segments must refer to a single resource.", "innerError": { "date": "2022-08-29T19:00:07", "request-id": "fdbf6dbd-15ff-4182-9d81-6c1c9f057ec7", ...

 

I keep getting this error when making a request with office365users. I wasn't getting this error before, but now it won't stop popping up. I pretty much have a people picker that looks at userphotometadata to check if they have a photo if they don't it enters a default photo. I'm also getting a photo error as well, I shouldn't be getting any errors at all, because if a returned item is blank my code skips it and yet I'm getting this error regardless. I'm not even sure how the request uri is invalid when it's using the built in search function to search through users. Office365Users.SearchUserV2({searchTerm:SearchUserBox.Text, top:6}).value this is built in, there is no URI or API call that I wrote with power automate. So how can the request be bad? It doesn't really make any sense. This also worked fine when I initially implemented it, and now it's doing this.

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    on at

    Hi @nBow ,

     

    The error is due to the UserPhotoMetadata action, it needs a single UPN rather than the result returned by the search user action, which is of type array could have 0 or more than 1 items. 

     

    Best regards,

  • nBow Profile Picture
    46 on at

    How do I fix this? I'm not sure how it's pulling an array, when the gallery is per item. The search users returns an array of possible users yes, but when the code accesses an item in the array and calls UserPhotoMetadata it shouldn't be accessing an array it should be accessing just ThisItem which is a single item. Thank you for the reply either way, that gives me some idea of what's wrong.

  • Verified answer
    nBow Profile Picture
    46 on at

    Actually I may have fixed the error. I told it to do nothing if any items are blank and I'm not seeing the error anymore. Not sure if this is a real fix though, or if it will break in some scenerios

  • v-jefferni Profile Picture
    on at

    Hi @nBow ,

     

    Basically it could solve the problem. You may consider share your formula and accept it as the solution to help others find it.

     

    Best regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard