Can someone please tell me how can I pass the following information to Flow using Power virtual agent.
1. Teams Type- Private or Public
2. Team Name
4. User Id of the person who is using the virtual agent
Please see the attached screenshot of the Virtual agent where I have defied the above information and the Flow HTTP action that I required above information to get in.
I'd like to know a bit more information about what you are trying to do.
In any case, you still need to address authentication as well as variables back and forth. For variables, you can use the templated flow inside actions to get started. Don't forget that in order to see that in your actions you will have to save it and import it into one of your solutions.
You also might want to look at authentication, unless any bot user is allowed to create any teams? Seems like you might want to register your app and authenticate the user to ensure you are only provision the correct levels of access to them.
@jpirelli Thanks for your reply.
Please see attached screenshot for Virtual agent and Flow.
See my Power virtual agent, do you know why I m getting a failure as marked on the red box.
Also can you tell me how can I pass the user ID (after the authentication) from Power Virtual agent to Flow to create the Team?
Can you please share the image of your Response Node with "Advanced options" open? It is possible that your Response Schema (hidden under Advanced options) does not match the Response Body?
This is actually a complex workflow you have outlined.
For authentication, you need to get that working, which is not trivial, then you need to query your directory for more information about the user from flow. I haven't yet worked out the details of this, but I am optimistic that I can use the auth token to query AD for more information about the users profile (alias, email address, etc)
Regarding the auth Token, you can just send it as a string to flow, see attached.
I feel like this part is the most complex and where the bulk of your effort will be. Everything is in flow from that point forward as far as I can tell until you return the response back to the user.
@jpirelli all good except Auth part, When I try to create MS teams using Http Post , I m getting an error saying
@CleberM for FYI
there are couple of places where this error could be coming from.
1. Authentication in PVA - I assume you have already set it up and the PVA is passing a non-empty String value for the token to your flow. You can verify that the token is non-empty in flow by looking at the flow run.
- this blog post will help you with setting up Authentication with Azure Active Directory in PVA step by step:
2. Passing a token to a Graph API call - there are 2 ways of doing this. You can either include your token in an Authorization header in your HTTP call, or you can use the Raw Authentication method.
- The token is not usually passed in HTTP Request Body.
See this blog for an example on how how to pass a token to a Graph API call with Authorization header or by using Raw Authentication method:
The Blog section that has examples of both token-passing methods is called this:
Include the access token in the request when making calls to Microsoft Graph
This blog might be helpful to you in general, since it has other posts on Graph API and Teams in Power Automate (flow).
Your flow scenario is quite deep, and it might be worth cross-posting this questions on Power Automate Community forum (https://powerusers.microsoft.com/t5/Microsoft-Power-Automate/ct-p/FlowCommunity) to get a deatiled solution faster. Most flow specialists focus on posts at Power Automate forum rather than Power VA community.
Hope this helps!
It looks like a similar problem was solved in this post - the use case is about reading records from Dynamics CRM, but PVA passing the AuthToken to a flow and using this AuthToken in an HTTP Request call to an API is the same:
Check out the winners of the recent 'Can You Solve These?' community challenge!
Join us for an in-depth look at the new Power Virtual Agents innovations at the free Microsoft Business Applications Launch Event.