Exercise - Build a Power Automate flow to send automated emails
In this unit, you learn how to:
- Create a custom table in Dataverse
- Build prescheduled flows by using a trigger called recurrence
You build a flow for the Contoso Coffee sales team that automatically pulls new sales opportunities from a Dataverse table daily.
Create a custom table
Follow these steps to create a new custom table.
Sign in to the link text Power Apps maker portal.
In the left navigation pane, select Tables, select New table, and then select Set advanced properties.
Rename the table Opportunity and select Save.
Under the Schema section, select Columns.
Select New column and enter the following values, and then select Save:
Display name: Opportunity Subject
Data type: Single line of text (this value is the default)
Let's add another column. Again select New column to add a new column.
In the New column pane, enter the following values, and then select Save:
Display name: Customer
Data type: Single line of text (this value is the default)
Select New column to add a new column button to add a new column.
In the New column pane, enter the following values, and then select Save:
Display name: Opportunity status
Data type: Choice
Create the choice values:
Set Sync with global choice to NoNew
You see two entry fields titled Label and Value. Enter New under the label. Power Apps assigns a value automatically. Change it to 1.
Select New choice and make Open the new entry for Label and 2 for Value.
Select New choice and make Closed the new entry for Label and 3 for Value.
Select Save.
Note
Make a note of the name (as opposed to display name) of the column. You will need that information when you create your flow.
Select New column to add a new column button to add a new column.
In the New column pane, enter the following values, and then select Save:
Display name: Amount
Data type: Currency
Create a scheduled flow
Select Flows.
Select New flow, and then select Scheduled cloud flow.
The default option is to repeat every 1 minute, however, you can change it to Minute, Week, Day, Hour and Second.
Name your flow New Sales Opportunities and under Run this flow set the flow to repeat every one week. Select Saturday and Sunday to remove those days from the flow.
Select Create.
Select New step to add an action.
Select Microsoft Dataverse to filter the search results to display only actions and triggers for Microsoft Dataverse.
Select List rows.
From the Table name list, select the Opportunity table you created. Please note that it may show up under the plural name Opportunities.
Add the advanced option Filter rows with [name of the opportunity status column] eq 1.
Note
Make sure that you enter only lower case letterse.
Select New step, to add another action.
Search for and select Create HTML table.
In the From field, select value.
Select New step, to add another action.
Search for and select Send an email (V2).
In the To field, enter your email address for test purposes.
In the Subject field, enter Daily Sales Opportunities.
In the Body field, select the Output from the Create HTML table.
Save and Test your flow.