1. Introduction
This article describes the integration between MS Forms (https://forms.office.com/) and Businessmap (https://businessmap.io) using MS Power Automate (https://make.powerautomate.com) and emails. A potential reader is expected to be familiar with Businessmap (boards, cards, etc.), MS Forms (forms, fields, etc.), and MS Power Automate (Businessmap connector, Outlook connector, loops, variables, arrays, etc.).
However, if you have any questions or encounter some difficulties along the way, do not hesitate to contact the Businessmap Support team at support@businessmap.io.
2. Integration Capabilities
This integration offers the following capabilities:
- Create a card when an MS Forms form is submitted.
- Populate custom fields from an MS Forms form into a Businessmap card.
- Populate the reported field into a Businessmap card based on the user who submitted the MS Forms form.
- Upload attachments from an MS Forms form into a Businessmap card.
3. Implementation
Step 1: Design the desired form in Microsoft Forms. Start by navigating to Microsoft Forms https://forms.office.com and selecting “New Form.” There you can design your form and add all your questions. As an example, we have created a sample Purchase Request form. See the image below.
Once the desired form has been created, select the “Collect Responses” button at the top right corner, and make sure that the “Only people in my organization can respond” option is selected. That is how you would get the email addresses to assign to the “Reporter” field. If you need to open the form to a wider audience outside of your organization, you will need to add a required field at the top for the email address of the person submitting the form.
Step 2: Configure the required custom fields into Businessmap. Log into Businessmap and create all the required custom fields to populate from your form. Continuing from our example, we have created the following custom fields from the form above:
- Vendor (Single-line Text)
- Purchase Link (Link)
- Total Price (Number)
- Recurring Payment (Dropdown)
Step 3: Set up an email integration in Businessmap. This can be done by following the steps in our dedicated article “How to Set Up Email Integration with Businessmap?”
Step 4: Create a Power Automate flow. Once both the form and the custom fields are set, the next step is to create a Power Automate flow. You can follow this link to open it: https://make.powerautomate.com. Once in Power Automate, select “Create,” and then “Automated cloud flow.” A pop-up window will open asking for the name of the flow and the trigger. The trigger will be “When a new response is submitted” by Microsoft Forms.
1. When the flow has been created, it will only have 1 activity, which is the trigger. Select the form created in Step 1 from the dropdown, click “New step,” and search for “Get response details” by Microsoft Forms.
2. Add the action, select the “Form Id” from the dropdown, and pass in the “Response Id” as a dynamic value from your trigger.
3. After the “Get Response Details” action, add an “Initialize variable” action, where you will set the SharePoint site address, where all the MS Forms attachments are stored. To get the SharePoint details, set the value of the variable to “substring(json({{AttachmentsField}})?['link'], 0, indexOf(json({{AttachmentsField}})?[0]?['link'],'/Documents/')).”
Please make sure to replace the {{AttachmentsFIeld}} placeholder with the dynamic value of the field that contains your attachments from MS Forms. The variable should be of type “String.”
4. Add another “Initialize variable” after the first one, where you will store the attachment's name and content. The type of the variable is “Array” and the initial value must remain blank.
5. Add an “Apply to each” action after that. This would ensure that all attachments are handled if there are multiple attachments to the response. The parameter that we will be looping through is the JSON value of the MS Forms response field “json({{AttachmentsField}}).” Please make sure to replace the {{AttachmentsFIeld}} placeholder with the dynamic value of the field that contains your attachments from MS Forms.
6. Inside the “Apply to each” action, you need to add 2 activities:
- “Get file content using path" from the SharePoint connector. Here the “Site Address” will be your variable from step 1 and the “File Path” will be “items('Apply_to_each')?['link']” where “items('Apply_to_each') is the dynamic content of the ”Apply to each" action.
- “Append to array variable,” where your variable will be the one initialized in Step 2, and the value to append will be:
{
“Name”: items('Apply_to_each')?['name'],
“ContentBytes”: outputs('Get_file_content_using_path')?['body']
}
where “items('Apply_to_each'): is the dynamic content of the “Apply to each” action and the “outputs('Get_file_content_using_path')" is the dynamic content of the ”Get file content using path" action.
7. The final step is to add a “Send an email (V2)” by Outlook activity:
- The ”To" field should contain the email address that was set up during the email integration.
- The “Subject” would be the title of the card and the “Body” would be the description.
- The custom fields and the Reporter field can be added to the beginning of the body in curly brackets, in the following format → { #reporter:value #Custom Field 1: value1 #Custom Field 2: value2}.
- The “Attachments” field should hold the “attachmentArray” variable, which was initialized in step 4 and populated in step 6.
- The original layout of the activity is set up to accept multiple values, however, pressing the “T” button next to the “Attachments” field allows a variable to be passed.
See the images below.
The final setup of this activity should look like the image below.
Step 4: Embed the form in Teams (optional) - If you would like to add your form to Teams as a tab, navigate to the channel you want and select the “+” button from the top panel, search for Forms, select “Add an existing form”, select the form you created, and click “Save.”