Hello wonderful community. I'm building a solution where HR users can use a PowerApp to enter details for new employees and then click a button that will trigger a Power Automate flow that will - among other things - create a user in Azure Active Directory. I'm using the HTTP action for this as that allows me to specify more attributes than the standard Azure AD connector allows.
The only thing that I can't seem to get working is setting the 'manager' attribute. Simply specifying this attribute with a value will return an error saying 'manager is an invalid property'. After searching online, I've found a JSON example where the 'manager' attribute is specified using a custom schema. The example looks as follows:
"urn:ietf:params:scim:schemas:extension:enterprise:2.0:User": {
"employeeNumber": "701984",
"costCenter": "4130",
"organization": "Universal Studios",
"division": "Theme Park",
"department": "Tour Operations",
"manager": {
"value": "26118915-6090-4610-87e4-49d8ca9f808d",
"$ref": "../Users/26118915-6090-4610-87e4-49d8ca9f808d",
"displayName": "John Smith"
}
Notice how the 'manager' attribute is provided as a JSON object with properties "value", "$ref" and "displayName". Using this approach in my own flow, the flow runs successfully and the user is created with all the attributes that I pass, except the 'manager' attribute.
I have searched extensively online but it seems more information on how to define the 'manager' attribute using a Power Automate flow is very scarce to say the least. So, I'm hoping someone here knows a little more about this and can help me get this final piece of my puzzle right 🙂
Solved! Go to Solution.
Hi @OliverR-82,
There is an assign manager method in the Graph API which you might be able to use in this scenario.
That method requires a PUT request btw:
https://learn.microsoft.com/en-us/graph/api/user-post-manager?view=graph-rest-1.0&tabs=http
Hi @OliverR-82,
There is an assign manager method in the Graph API which you might be able to use in this scenario.
That method requires a PUT request btw:
https://learn.microsoft.com/en-us/graph/api/user-post-manager?view=graph-rest-1.0&tabs=http
Hi @Expiscornovus , thanks for that link, that works.
Ideally I would have liked to set the manager attribute when creating the user instead of having to make an additional Graph API call, but if that's not possible then I guess I'll do it this way.
Thanks again!
User | Count |
---|---|
89 | |
37 | |
26 | |
13 | |
12 |
User | Count |
---|---|
128 | |
53 | |
38 | |
26 | |
21 |