Hello Harsha Jha,
I understand you're trying to assign a manager using Microsoft Graph and encountering the error:
"The input parameter(s) of operation 'updateManagerForGuestUserDetails' contains invalid expression(s)"
This usually happens because Power Automate doesn't handle dynamic content properly when it's placed directly inside the JSON body, especially in the @odata.id
field.
Initially, I too got same error when I tried to assign manager using a variable directly in the body, as shown below:
To fix this, you can build the body as a complete JSON string using an expression. This avoids parsing errors during runtime. For the Body, use the following expression:
concat('{\"@odata.id\":\"https://graph.microsoft.com/v1.0/users/', variables('ManagerUserID'), '\"}')
This ensures the entire value is treated as a valid JSON string. The URI can remain as is. With the correct object IDs and permissions, this should work without errors.
To confirm that, you can below API call in Graph Explorer and check the user's manager details:
GET https://graph.microsoft.com/v1.0/users/userId/manager/
Hope this helps!
If this answers your query, do click Accept Answer
and Yes
for was this answer helpful, which may help members with similar questions.
If you have any other questions or are still experiencing issues, feel free to ask in the "comments" section, and I'd be happy to help.