Exercise - Create a flow outside of a solution

Completed

In this exercise, you'll create a cloud flow outside of a Dataverse solution.

Important

Use a test environment with Dataverse.

Exercise 1: Create a cloud flow

In this task, you'll create a cloud flow that will send a daily weather notification for a certain city.

  1. Go to Power Automate and make sure that you're in the correct environment.

  2. Select My flows.

  3. Select + New flow > Scheduled cloud flow.

  4. Enter Daily weather in the Flow name field, and in the Repeat every section, select 1 Day. Select Create.

    Screenshot of Build a scheduled cloud flow configuration.

  5. Select + New step.

  6. Search for weather and then select Get forecast for today (MSN Weather).

  7. Enter Denver or any city that you want for Location, select Imperial for Units, and then select + New step.

    Screenshot of the Get forecast for today flow step.

  8. Search for send email and then select Send me an email notification.

  9. Enter Today's weather for Subject, select in the Body field, and then select Day Summary from the Dynamic content pane.

    Screenshot of the Send me an email notification flow step.

  10. Type with High in the Body field and then select Temperature High from the Dynamic content pane.

  11. Type and Low in the Body field and then select Temperature Low from the Dynamic content pane.

  12. The Send me an email notification step should resemble the following image. Select Save and then wait for the flow to be saved.

    Screenshot of the Send me an email notification flow step with the Save button highlighted.

  13. Select the back button.

    Screenshot of the back to flow details button.

  14. Select Run.

  15. Select Run flow.

  16. Select Done.

    The flow run should succeed.

    Screenshot of the flow run history with the Succeeded status highlighted.

  17. Select the App launcher, right-click Outlook, and then select Open in a new tab.

    Screenshot of the app launcher with the Outlook option selected and the Open in new tab button highlighted.

  18. You should receive the email notification that's sent by the flow. Select to open the email.

    The email should resemble the following image.

    Screenshot of an email sent by the cloud flow.

Exercise 2: Create a solution and a publisher

In this exercise, you'll create a solution and a publisher, and then you'll add the cloud flow that you created to the solution.

Task 1: Create a solution and a publisher

In this task, you'll create a solution and a publisher.

  1. Go to Power Automate and make sure that you're in the correct environment.

  2. Select Solutions > + New solution.

  3. Enter My Automations for Display name, MyAutomations for Name, and then select the + New publisher button.

    Screenshot of the create new solution dialog.

  4. Enter Contoso for Display name, Contoso for Name, contoso for Prefix, and then select Save.

  5. Select the Contoso publisher that you created, select Publisher, and then select Create.

  6. Don't navigate away from this page.

Task 2: Add the cloud flow to your solution

In this task, you'll add the cloud flow to your solution.

  1. Make sure that you still have Solutions selected.

  2. Open the My Automations solution that you created.

  3. Select Add existing and then select Automation > Cloud flow.

  4. Select the Outside Dataverse tab.

  5. Select the Daily weather cloud flow that you created and then select Add.

    Screenshot showing the Add existing cloud flows to solution dialog.

  6. Don't navigate away from this page.

Exercise 3: Use environment variables

In this exercise, you'll create an environment variable for the weather location and then use the location in the cloud flow.

Task 1: Create an environment variable

In this task, you'll create an environment variable.

  1. Make sure that you still have the My Automations solution selected.

  2. Select + New > More > Environment variable.

    Screenshot showing the process of adding a new environment variable.

  3. Enter Location for Display name, Location for Name, Text for Data type, and then select the + New value button.

  4. Enter Seattle for Current Value and then select Save.

    Screenshot showing the current environment value.

  5. Select to open the Location environment variable that you created.

  6. Select the ellipsis (...) button next to current value and then select Remove from this solution. You're removing the current value from the solution because you want other people who use this solution to provide their location.

    Screenshot showing the Remove from this solution option to remove the current value.

  7. Close the Edit location pane.

  8. Don't navigate away from this page.

Task 2: Edit the flow

In this task, you'll edit the flow to use the environment location variable.

  1. From the solution, open the Daily weather cloud flow that you added to the solution.

  2. Select Edit.

    Screenshot showing the Edit button.

  3. Expand the Get forecast for today step.

  4. Remove the location text that currently reads Denver.

  5. Select the Location field, go to the Dynamic content pane, and then select Location.

    Screenshot showing the selection of a dynamic component for the email notification.

  6. Expand the Send me an email notification step.

  7. In front of the Body text, add In and then select Location from the Dynamic content pane.

    Screenshot of the process of adding a dynamic component for the email notification.

  8. Add a colon (:) after the location and then select Save.

  9. Wait for the flow to be saved.

  10. Select Test.

  11. Select Manually and then select Test.

  12. Select Run flow.

  13. Select Done.

    The flow should run successfully.

  14. Select the App launcher, right-click Outlook, and then select Open in new tab.

    Screenshot of the app launcher and the option to launch Outlook in a new tab.

  15. You should receive the email notification that's sent by the flow. Select to open the email.

    The email should show the weather for Seattle.

    Screenshot of an email sent by the cloud flow for Seattle weather.

Exercise 4: Export the solution

In this exercise, you'll export the solution that you created.

  1. Go to Power Automate and make sure that you're in the correct environment.

  2. Select Solutions, select the My Automation solution that you created, and then select Export.

    Screenshot of the Export button.

  3. Select Publish and then wait for the publishing to complete.

  4. Select Next.

  5. Select Managed and then select Export.

  6. Wait for the solution to be exported.

  7. Save the exported solution on your machine.

Exercise 5: (Optional) Import the solution

In this exercise, you'll import the solution that you created into a new environment.

Important

You will need a second test environment.

  1. Go to Power Automate and make sure that you're in the correct environment.

  2. Select Solutions > Import.

    Screenshot of the Import button.

  3. Select Browse.

  4. Select the MyAutomation_1_0_0_1_managed.zip solution that you exported and then select Open.

  5. Select Next.

  6. Select Next again.

  7. You should be asked to provide a Location. Enter Phoenix for Location and then select Import.

    Screenshot of the Import a solution dialog with Phoenix entered as the Location.

  8. Wait for the import to complete.

  9. Open the My Automations solution that you created.

  10. Open the Daily weather cloud flow inside the solution.

  11. Select Edit.

  12. Expand the weather step and then select + Add new connection.

    Screenshot of the Add new connection button.

  13. Expand the email step and then select + Add new connection.

  14. Select Save to save the flow and then wait for the flow to be saved.

  15. Select the back button next to the flow name.

  16. Select the Turn on button to turn on the flow.

  17. Select Run to run the flow.

  18. Select Run flow.

  19. Select Done.

  20. Select the App launcher, right-click Outlook, and then select Open in new tab.

    Screenshot of the app launcher with the Outlook option selected and the Open in new tab button highlighted.

  21. You should receive the email notification that's sent by the flow. Select to open the email.

    The email should show the weather for Phoenix.

    Screenshot of an email sent by the cloud flow for Phoenix weather.