Reader small image

You're reading from  Workflow Automation with Microsoft Power Automate - Second Edition

Product typeBook
Published inAug 2022
PublisherPackt
ISBN-139781803237671
Edition2nd Edition
Right arrow
Author (1)
Aaron Guilmette
Aaron Guilmette
author image
Aaron Guilmette

Aaron Guilmette is a Senior Program Manager with the Microsoft 365 Customer Experience, helping customers adopt and deploy the Microsoft 365 platform. He primarily focuses on collaborative technologies, including Microsoft Teams, Exchange Online, and Azure Active Directory.
Read more about Aaron Guilmette

Right arrow

Working with Microsoft Forms

Gathering and processing feedback from users or customers is an important part of business operations. Microsoft Forms is a survey tool that can be used to capture that information, both with fixed questions and free-form text entry options.

In this chapter, we’re going to build on the concepts we’ve already learned regarding conditions (Chapter 8, Working with Conditions) and adding content to a database (Chapter 12, Using a Database) to create flows based on input from Microsoft Forms and save it to a SQL database. Specifically, we’ll look at the following topics:

  • Understanding the Forms connector triggers and actions
  • Creating a basic form
  • Processing a form with Power Automate

When you finish this chapter, you’ll have an understanding of how you can connect Forms and SQL with Power Automate.

Let’s dig in!

Understanding the Forms connector triggers and actions

Before we can begin crafting a flow that involves Microsoft Forms, it’s important to understand what kinds of triggers and actions are available for the Forms connector. As a reminder, triggers are activities that can initiate a flow, and actions are the activities that a flow can perform. If you need to brush up on your terminology, you can refer back to Chapter 1, Introducing Microsoft Power Automate.

Triggers

As mentioned in the introduction, Microsoft Forms is a survey and information gathering tool. An end user’s interaction with Forms finishes when they complete and submit the form. As such, the Forms connector currently has only one trigger: When a new response is submitted. This trigger is activated when a user submits a form to the service.

Actions

The Forms connector also has only a single action: Get response details. Using this action, Power Automate can retrieve the data submitted by...

Creating a basic form

The Forms application is relatively straightforward to use. In this section, we’ll create a basic form to collect user information. To create the form, follow these steps:

  1. Launch the Forms application by navigating to https://forms.office.com and signing in.
  2. If this is your first time signing into Forms, click the Create a new form button on the splash page. If you’ve logged into Forms previously, you can click the New Form button on the dashboard:

Figure 13.1: Microsoft Forms splash page

  1. Click the title area (Untitled form) text box and enter a name for the form, such as Customer Survey, as shown in Figure 13.2:

Figure 13.2: Adding a title to the form

  1. Click Add new to add a new item.
  2. Select the Text option:

Figure 13.3: Selecting the text data type

  1. Enter the value CompanyName. You can enter something more descriptive if desired, but for the purposes...

Processing a form with Power Automate

In this exercise, we’ll configure a flow to process the responses and save them into the database you created in Chapter 12, Using a Database. The flow will utilize the form ID value you saved in the previous exercise, the When a new response is submitted trigger, and the Get response details action for the Microsoft Forms connector.

Follow these steps to configure the flow:

  1. Log into the Power Automate web portal (https://flow.microsoft.com) and click Create.
  2. Under the Start from blank section, select Automated cloud flow.
  3. Enter a name for the flow (such as Customer Survey) and select the When a new response is submitted trigger for Microsoft Forms. Click Create:

Figure 13.7: Creating a new automated cloud flow with the Forms trigger

  1. In the details for the trigger, select the form if it is displayed. If the form you created is not displayed, select Add a custom item and paste in the form...

Testing the flow

In order to test the flow, you will need to submit a form response. To submit a form response, follow these steps:

  1. Navigate to the Microsoft Forms dashboard (https://forms.office.com) and select your form under My forms:

Figure 13.14: Forms dashboard

  1. Select Preview.
  2. Fill out the form and click Submit:

Figure 13.15: Submitting the form

After the form has been submitted, you will receive a confirmation page indicating that your submission was successful.

Next, we’ll verify that the flow ran successfully.

Verifying the result

Finally, you’ll want to ensure that the flow has completed as you anticipated. You can check to see if the Forms data was written by flow to the database by examining the flow’s run history or by querying the database table in SQL.

Reviewing the run history

The easiest and quickest way to verify if the flow is successful is to examine the run history. The run history will show the steps performed during the flow’s execution. You can review the run history for the flow by using the following process:

  1. From the Power Automate web portal (https://flow.microsoft.com), click My flows and then select the Customer Survey flow.
  2. Click the ellipsis for the flow and then select Run history.
  3. Click on the date for the run:

Figure 13.16: Expanding the flow run

  1. Expand the Insert row (V2) action and review the data:

Figure 13.17: Viewing the run detail for the Insert Row (V2) SQL action

...

Summary

In this chapter, you learned how to create a basic form using Microsoft Forms. Additionally, you were able to build upon the skills acquired in Chapter 12, Using a Database, to save data from Microsoft Forms into a SQL database.

In real-world scenarios, you could expand this flow further to generate a confirmation email back to the submitter or use a tool such as Excel or Power BI to sort the data. Depending on the type of data gathered in the form, you could even send this data to Azure Cognitive Services for sentiment analysis (which you’ll learn about in Chapter 17, Introducing AI Models).

In the next chapter, we’ll look at using Power Automate to gather user input directly. This will allow you to create more interactive flows.

Learn more on Discord

To join the Discord community for this book – where you can share feedback, ask questions to the author, and learn about new releases – follow the QR code below:

https://packt...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Workflow Automation with Microsoft Power Automate - Second Edition
Published in: Aug 2022Publisher: PacktISBN-13: 9781803237671
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Aaron Guilmette

Aaron Guilmette is a Senior Program Manager with the Microsoft 365 Customer Experience, helping customers adopt and deploy the Microsoft 365 platform. He primarily focuses on collaborative technologies, including Microsoft Teams, Exchange Online, and Azure Active Directory.
Read more about Aaron Guilmette