Microsoft Power Virtual Agents - error in Power Virtual Agents Flow Template

841 Views Asked by At

I am trying to code this Microsoft Virtual Agent in Microsoft Teams using this example:

https://powerusers.microsoft.com/t5/Power-Virtual-Agents-Community/Getting-User-Details-To-Use-In-Power-Virtual-Agents-In-Teams/ba-p/744934

BTW - I have other topics on the chat bot working - it is just this one topic that tries to get detailed user information - that is not working

I get it coded, run it, and it throws an error: Error: Action 'Get_user_profile_(V2)_2' failed Error Details: Bad Request - Error in query syntax.

Microsoft Teams gives me the user name. To get the user's email - I call SearchForUsers() - which properly returns information about the user specified by the user name. SearchForUsers() returns a list (or array) of users. In this case - there is only one user in the list, but still a list, so in the next call to GetUserProfile() I specify "first" to get one user out of the list. The property "UserPrincipalName" does contain the correct email to lookup the user profile. So SearchForUsers() appears to output the correct values.

My input to GetUserProfile is: first(outputs('Search_for_users_(V2)')?['body/value'])?['UserPrincipalName']

It appears that there is something wrong with this query - but I do not see the problem.

Any ideas? Thanks

Call to GetUserProfile()

1

There are 1 best solutions below

0
On BEST ANSWER

Instead of passing in display name - pass in UserID. Then you do not need the call SearchForUsers()

Action

Flow