cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VeeLearnMSFT
Post Patron
Post Patron

PVA Send mail with Message INput

Can someone please present an example of how I can build a PVA flow where I can ask the bot to send an email to someone in the ACTIVE directory, not sure if we can use the name or do we need to input the whole email...that is a minor thing though. The second thing would be to send a message. So first the bot would say who do you want to send an email to and the second thing would be what do you want to say.  Is that possible ?  If so if someone would be kind enough to show an example that would be awesome..Thank you kindly.

2 REPLIES 2
Monkeyman
Resolver III
Resolver III

Yes. You can do this with Power Automate. 

Steps

 

1. Go into Power Virtual Agents and to the topic you want to use the cloud flow.

2. Click on the plus icon under a step and click call an action and then create a power automate cloud flow

3. Power Automate will open with a trigger step from Power Virtual Agents and an end step returning values back to Power Virtual Agents. 
4. Expand the trigger step and create two text inputs, one for Email Address, the other for Email Message. 

5. Add another step under this in the flow and search for Office365 Users, and use the Get Profile action

6. For the UPN choose the  Email Address from the step above in the dynamic content box that appears. 
7. Add a compose step, and type in The Email address is invalid. 
8. Click the three dots on the compose step and select configure run after, only tick the is failed box.

9. Add a new step under the compose and find the Send an Email action

10. Use the mail from the Office 365 action in the To: field and use the Email message value in the body section. 

11. Click on the three dots on Send an email action and click Configure run after, click the tick in the failed checkbox only.

12. Add a new step, a compose action and in the text field type “The message has been sent successfully”. 
13. In the Return values to Power Virtual agent step, add an output and select both output dynamic content values from both the first and second compose steps. 

mark this as a solution if this helped. Thanks. 

VeeLearnMSFT
Post Patron
Post Patron

HI Monkeyman,

Also is there a way for a user to type the persons name and the chatbot provides a list of addresses? or does the user always have to input an accurate email address?  Is there a way to provide a selection of an email address?

 

So I got it to work only after removing the configure run after and selecting successful. If i change it to is failed it does not send.  When I pass the email you can see in the Get user profiel (v2) that it matched that the account is enabled but it fails in the first componse action when I enable the "if failed".  Do I need to flip it to successful?

VeeLearnMSFT_6-1651928323459.png

 

VeeLearnMSFT_0-1651927528258.png

It fails at the compose if i enable if failed:

VeeLearnMSFT_1-1651927561408.png

VeeLearnMSFT_4-1651927968477.png

 

If I remove the "if fails" run after my flow works:

 

 

 

VeeLearnMSFT_2-1651927663350.png

VeeLearnMSFT_3-1651927698213.png

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Canadian Cloud 2022 768x460.png

Register for a free PVA chatbot creation workshop.

Learn how to respond rapidly to your customers and employees at scale, using intelligent conversational chatbots.

Top Solution Authors
Users online (5,156)