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.Manager...
Power Apps
Suggested Answer

Office365Users.Manager failed: The function 'Manager' has an invalid value for parameter 'userId'

(0) ShareShare
ReportReport
Posted on by 1,811 Super User 2024 Season 1
I have a combobox with this formula inside its DefaultSelectedItems:-
 
    If(
        CountRows(varManager) <> 0 && !IsBlank(varManager) && !IsBlank(Last(varManager).Email) && !IsEmpty(varManager),
        {
            DisplayName: Office365Users.Manager(Last(varManager).Email).DisplayName,
            Claims: "i:0#.f|membership|" & Lower(Office365Users.Manager(Last(varManager).Email).Mail),
            Department: "",
            Email: Office365Users.Manager(Last(varManager).Email).Mail,
            JobTitle: "",
            Picture: ""
        },
        Blank()
    )
 
and the varManager is a variable that got initiated inside the screen onvisible property, as follow:-
 
 
Set(varManager,Filter(TR_PersonalDetails,TRID = SelectedReportTR.TripTypeID));
 
 
now when i first visit the home page (not even the related page), i always get this error "Office365Users.Manager failed: The function 'Manager' has an invalid value for parameter 'userId'":-
 
 
while on design mode, while i am developing the app, i will not get this error? so what could be the reason? that i always get this error even if the varManager is Empty() ??? and even if i do not visit the related page where this Combo box is?
 
Thanks
 
Categories:
I have the same question (0)
  • Suggested answer
    Gabriel G. Profile Picture
    831 Super User 2025 Season 2 on at
    Firstly, Set(var, value) is for global variables, which means you keep the variable active until you close the application. You should use UpdateContext({var: value}) if you want a context variable.
     
    Secondly, you should use LookUp function instead of Filter here:
    Set(varManager,LookUp(TR_PersonalDetails,TRID = SelectedReportTR.TripTypeID));
     
     
    Then, you will only use varManager.Email and not Last(varManager).Email
     
    The code will be clearer.

    Finally, you should use ManagerV2 since Manager function is deprecated. For example:
     
    Office365Users.ManagerV2(varManager.Email).displayName
     
    Now, if you still have an error, maybe try to just put a label field in your app to show what is varManager.Email exactly to validate if your email has a good value. I think you should make some error handling by validate the email before passing it as a parameter to the connector.

    I hope it helps!
    _________________________________________________________________
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
  • johnjohnPter Profile Picture
    1,811 Super User 2024 Season 1 on at
    i tried the following as per your reply:-
    1) use UpdateContext instead of global var
    2) use Office365Users.ManagerV2
    3) use Lookup instead of filter

    but still i am facing the same error!! any further advice?
    Thanks

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