Learning Objective
In this exercise, learners will create a series of different cloud flows using Microsoft Copilot in Power Automate. You will use different creation methods such as Copilot and from scratch to become familiar with the different options available.
Upon successful completion of this exercise, you will:
- Use natural language prompts to design workflows
- Configure triggers and actions
- Test the automation for practical use.
Scenario
Contoso Consulting is a professional services organization specializing in IT and AI consulting services. Throughout the year, they offer many different events to their customers. Some of these are trade shows style events where they have many partners come in and provide details on new products, market trends, and services. Others occur throughout the year and are quick webinars that are used to provide details about individual products. Additionally, Contoso is beginning to use automated Agents to assist customers with questions.
Contoso would like to use Power Automate to build a registration confirmation flow that will send an automated email to a customer when they register for an event. Additionally, they want to create a Flow that will use AI to provide generative answers to customer questions.
In this exercise you are going to build a series of power Automate flows based on specific criteria.
Before beginning this exercise, required that you have completed the following lab:
- Lab 3 – Create a data model
- Lab 5 – Build a model-driven app
Exercise 1: Create Session Registration notification flow
In this first exercise, you are going to be building a flow that will run automatically when a new Session Registration is created. It will get the details of the session, event, and contact who registered and send an email to this with their registration details.
Task 1: Create a flow
We want to send a registration confirmation to any newly registered users. We will create a flow that will capture details of a registration and send a confirmation email to the registered user.
- Navigate to https://make.powerautomate.com.
- You may need to reauthenticate, select Sign in and follow instructions, if needed.
- In the Create you automation with Copilot screen, enter: “When a new Session Registration is created in Dataverse, get the details of the session and the event the registration is for an send a confirmation email to registered person.”
- Copilot will suggest a potential flow based on your description.
- It should look like the image below:
- Select Keep it and continue.
- Review the connections to ensure everything is correct.
- Select Create flow.
- Choose the trigger When a row is added, modified, or deleted.
- Populate the trigger conditions for the flow:
- Select Added for Change type
- Select Session Registrations for the Table name
- Select Organization for Scope
- Select the text When a row is added, modified, or deleted and rename the trigger step When an Expense Report is added.
This is good practice, so you and other flow editors can understand the purpose of the step without having to dive into the details.
Task 2: Create a step to get the details of the Event Session the Registration is for.
- Select Get a row by ID step.
- Select Event Sessions as Table name
- Select the Row ID field. Notice that a window pops up to select Dynamic content or Expressions.
- In the Row ID field, select Event Session (Value) from the Dynamic content list.
- Select the Get a row by ID text, and rename this action Get Event Session.
Next, we are going to get the details of the Event the session is in.
- Select Get a row by ID 2 step.
- Select Events as Table name
- Select the Row ID field. Notice that a window pops up to select Dynamic content or Expressions.
- In the Row ID field, select Event (Value) from the Dynamic content list.
- Select the Get a row by ID text, and rename this action Get Event.
Lastly, we are going to get the details of the person registered for the session.
- Under the Get Event Details, set select Insert new Action.
- In the search field enter Dataverse.
- Select Get a row by ID.
- Select Contacts as Table name
- Select the Row ID field. Notice that a window pops up to select Dynamic content or Expressions.
- In the Row ID field, select Participant (Value) from the Dynamic content list.
- Select the Get a row by ID text, and rename this action Get Participant Details.
Task 3: Create a step to send an email to confirm session registration
- Select the Send email step.
- Select the Gear icon above the To field and select Use Dynamic Values.
- Select the To field and using Dynamic values, select Email under the Get Participant Details.
- In the Subject field, make sure it says Registration Confirmation.
- Enter the following text in Email Body:
[!NOTE] Dynamic content needs to be placed where fields are named in brackets. It is recommended to copy & paste all text first and then add dynamic content in the correct places.
Dear {First Name}, Thank you for registering for our upcoming session {Session Name} on {Event Date}. Speaker {Value} will be your speaker in this session. Your session is scheduled to last {Duration (Hours)}. Check out our other session at our {Event Name}.
Best regards,
Events Administration
Contoso Consulting
- Highlight the {First Name} text. Replace it with the First Name field from the Get Participant Details step.
- Highlight the {Session Name} text. Replace it with the Session Name field from the Get Event Session step.
- Highlight the {Event Date} text. Replace it with the Event Date field from the Get Event Details step.
- Highlight the {Duration (Hours)} text. Replace it with the Duration (Hours) field from the Get Event Session step.
- Highlight the {Event Name} text. Replace it with the Event Name field from the Get Event Details step.
Your completed step should resemble the image:
- Select Save.
Leave this flow tab open for the next task. Your flow should look like the following:
Task 4: Validate and test the flow
- Open a new tab in your browser and navigate to https://make.powerapps.com.
- Select the Dev One environment at the top right if it is not already selected.
- Select Apps and open the Contoso Event Management App.
- Leaving this browser tab open, navigate back to the previous tab with your flow.
- On the command bar, select Test. Select Manually and then select Test.
- Navigate to the browser tab with your model-driven app open.
- Using the sitemap navigation on the left, select Session Registration.
- Select the + New button to add a new Session Registration record.
- Complete the Session Registration record as follows:
- Report Name: Test Report
- Report Purpose: Conference
- Report due date: Tomorrow
- Select the Save & Close button.
- Navigate to the browser tab where your Flow test is running. After a short delay, you should see the flow running. This is where you can catch any issues in the flow or confirm that it ran successfully.
After a short delay, you should see an email in your inbox.
[!NOTE] It may go to your Junk email folder.
Exercise 2: Create a technology troubleshooting flow
Task 1: Create a technology troubleshooting flow
In this exercise, you will create a Power Automate flow that will be run form an Agent that will capture symptoms and use it to diagnose the technology issue.
- Open Power Automate.
- Using the navigation on the left, select Create.
- Select Automated cloud flow.
- Select the Skip button.
- Select the Add a trigger box. Search for and select When an agent calls the flow.
- Select Add an Input.
- Select Text and change the name from Input to Device Type.
- Select Add an Input again, choose Text, and change the name from Input to Problem Type.
- Select Add an Input one last time, choose Text, and change the name from Input to Problem Description.
Your completed trigger should resemble the following image:
[!IMPORTANT] If we were creating a technology true symptom checker, we would capture multiple different inputs to help the answers generated to be as accurate as possible. For this exercise, we are just demonstrating how you would do it.
Specify an action
- Under the When an agent calls the flow trigger, select Insert a new step (+).
- In the add an action window, search for, and select Run a prompt.
- In the Run a prompt window, set the Prompt field to AI Summarize.
- In the Input Text field, select the Dynamics value (Lightning bolt) icon.
- Under When an agent calls the flow, select the following dynamic values:
- Device Type
- Problem Type
- Problem Description
- Under the Run a Prompt step, select Insert a new step (+)
- In the Add an action window, enter “Respond”, and select Respond to the agent.
- Select Add an output.
- Select Text.
- Set the name of the output to Summarized Text.
- In the Enter a value to respond with field, select Dynamic value (Lighting bolt)
- Search for and select Body.
Your completed Respond to the agent step, should resemble the following:
- Select Save.
- Select the Test button.
- In the test Flow pane, select Manually.
- Select the Test button.
- In the Run Flow pane, Enter the following: - Device Type: Windows PC - Problem Type: Unresponsive Application - Problem Description: When Launching Microsoft Excel, the application will begin to load but will freeze up just after the Excel Splash screen. It just sits there and nothing happens.
- Select the Run flow button.
- Once the test is complete, select the Run a Prompt step. Notice that Switch back to the Designer tab.
- Select Publish.