Updated: Dec 5, 2019
In this blog post we will look at how we can capture an input from Microsoft Forms and then use the data to encode within a QR code using the Vantage 365 Imaging connector. We will first of all create a basic form using Microsoft Forms, and then use Power Automate to take the input, encode it, and then send the information in an email.
In order to follow the example in this blog you will need to either have a Community Plan subscription, or a Per User/Per Process license assigned to you within Office 365. You will also need access to Microsoft Forms to create a basic Form.
To begin with we will need to create a Form for us to capture an input.
1. Log into the Office 365 Portal: portal.office.com
2. Select Microsoft Forms from the App Launcher
3. When Forms loads, select New Survey (New Pro Survey if you're using Forms Pro)
4. When the Form editor loads, create your questions. For this demo I am only using a single question: "What is your name?"
When you make updated to Microsoft Forms, the changes will automatically be changed. Now that my Form has been created, I will go across to Power Automate in order to start creating the automation.
To access Power Automate, navigate to flow.microsoft.com so that you see the Power Automate portal.
1. Select "Create" from the left navigation. We will want our Flow to trigger when a new response is submitted, which is classed as an automated trigger. Therefore, select "Automated flow" under the "Start from blank" section.
2. When the Create dialoge box appears, enter the name of your Flow, and select the trigger from below. As we're working with Forms, we need to select "When a new response is submitted". Once configured, click Create.
3. When the Flow canvas loads the trigger will be placed on the screen, however you will need to select the Form which we are going to monitor for responses.
4. The information that we get from the trigger doesn't contain the questions or answers, so we need to add an action to get that. We need to add "Get response details" to retrieve the answers that the user submitted through the Form.
5. Once the action is on the canvas, select the relevant Form Id from the drop down. In the Response ID, we need to get the ID which is passed through the trigger. However, the trigger returns an array, so it will automatically put the "Get response details" action into a loop. If you want to keep your Flow tidier, then you could consider using an expression. Place your cursor into the Response Id field, and select Expression from the dynamic content, and enter the following expression: triggerBody()?['value']?['resourceData']?['responseId']
6. Now that we have the response details, we can get the responses to any of the questions that were asked within the Form. The questions will be available in the dynamic content in any subsequent actions. I can now go ahead and use the Vantage 365 Imaging Connector, and the Generate Basic QR Code action to encode the data. In this example, we will use the response to "What is your name?"
7. To send the generated QR code in an email, I can use any of the send email actions. In this example we will use the "Send an email notification" action. When that's be added to your canvas, configure the To and Subject lines as you require.
8. In order to place the QR code into the email, we need to switch the Email body to use HTML by clicking on the </> button. Once in there we can place the QR code into the email body by using the following: <img src="[dynamic content for QR code]">
We now have all parts of the Flow completed, so we can trigger it by adding an entry to the Form. The result is that we will receive an email with the QR code containing the answer to the question.
We have now created a Flow which will take an entry from Microsoft Forms, encode the output in a QR code and then send that in an email. If you are interested in using the QR code visit the Vantage 365 Store or alternatively contact firstname.lastname@example.org.