cancel
Showing results for 
Search instead for 
Did you mean: 
CFernandes

Record Microsoft Form choice response to the SharePoint list

A few days back, I was working with one of our customers. His requirement was very simple and he wanted to record Microsoft Forms choice response in a SharePoint List.

I quickly googled and found  a template which exactly meets the customer requirements but he said that the template did not work for him. To be very honest, the customers form was very simple with a multi choice field but when he tried updating the SharePoint list, Power Automate complained. At that point I realized that something simple can also turn into a complicated scenario.

 

So lets quickly understand the problem statement and resolve it.

 

Microsoft Form:

 

image-11

 

  • The Form has a Single Question with a Multi Choice Input.
  • The Data-Source for the Form is OneDrive for Business Excel.
  • The Data in Excel is save in the Format below.

Untitled.png

 

SharePoint List:

 

image-18

 

Problem in Power Automate:

 

If you have a close look at the Power Automate screenshot you will see that the SharePoint Column Gift in Drop down and accepts an array but Power Automate return the values from Excel as a string.

 

image-19

 

To work around the problem, we need to Convert the individual items as an array element and pass it to our SharePoint Control.

 

From a High-Level our Power Automate would look like the screenshot below:

 

image-20

 

Without wasting any further time, lets start building our Power Automate Solution:

 

Step 1: We will use the trigger ‘When a new response is submitted’.

  • This means that, whenever a new response gets submitted on the configured Microsoft Form, the Power Automate will get triggered automatically.
  • For the ‘Form Id’ in the image below, choose the correct Microsoft Form from the drop down menu.

 

image-12

 

Step 2: Add the ‘Delay‘  action to your Power Automate so that we can wait for responses to be updated in Excel.

 

  • Set the ‘Count‘ value on 1.
  • Unit as ‘Minute‘.

image-21

 

 

Step 3: Initial a variable of type ‘String‘ and Name is ‘Email‘ and another variable of type ‘Array‘ and Name ‘Sample Array‘.

 

image-13

 

Step 4: Add the Excel Online (Business) ‘Get a row’ action.

 

  • Location: From the drop down select ‘OneDrive for Business‘.
  • Document Library: Select the Document Library which holds the file.
  • File: Choose the Excel File path.
  • Table: From the dropdown select the ‘Table1‘.
  • Key Column: From the dropdown select ‘ID‘.
  • Key Value: ‘Response Id’ the output of the Microsoft Forms ‘ When a new response is submitted‘ action.

 

Note: It will automatically add a ‘Apply to each‘ loop around the action.

 

image-14

 

Step 5Transform the String to Array. Add the Set() function to Convert the String to Array.

 

 

 

 

 

split(outputs('Get_a_row')?['body/What gift would you prefer?2'],';')

 

 

 

 

 

 

image-22

 

Step 8: Add the ‘Filter array‘ action.

 

  • From: Select the ‘Outputs‘ of the ‘Split Choices‘ action.
  • Condition:
    • empty(item()) is equal to false.

image-15

 

Explanation:

 

  • The ‘Split‘ function returns and array with an empty value.
  • With the ‘Filter array‘ action we will remove the empty value from out array.

 

image-23

 

Step 9: Add the ‘Select‘ action to the.

 

  • From: Select the ‘Outputs‘ of the ‘Filter array‘  action.
  • Map: Value to the function ‘item()‘.

image-24

 

Explanation: This will transform the array in format that is accepted by SharePoint Multiple Choice .

 

image-29

 

Step 10: Set the ‘Sample Array‘ variable value to output of the ‘Select‘ action.

 

image-25

 

Step 11:  Set the ‘EmailAddress‘ variable value to ‘Email‘ of the output of the Excel ‘Get a row’ action.

image-26

 

Step 12 : Outside the ‘Apply to each loop‘, add the SharePoint ‘Create item‘ action.

 

  • Site Address: Set to the target SharePoint site.
  • List Name: Select the list from the dropdown(it should auto-populate) the Columns.
  • Title: Set the ‘Email Address‘ variable.
  • Gift(Choice Input): Set it to ‘Sample Array‘ variable.

 

image-27

 

All done!

 

  •  Fill in the Microsoft Form, this will Trigger the Power Automate.
  • After few seconds, a new item should be created in your list with Multiple Choice column populated(screenshot below).

image-16

 

Thank you for reading 🙂

About the Author
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • I am a Microsoft Business Applications MVP and a Senior Manager at EY. I am a technology enthusiast and problem solver. I work/speak/blog/Vlog on Microsoft technology, including Office 365, Power Apps, Power Automate, SharePoint, and Teams Etc. I am helping global clients on Power Platform adoption and empowering them with Power Platform possibilities, capabilities, and easiness. I am a leader of the Houston Power Platform User Group and Power Automate community superuser. I love traveling , exploring new places, and meeting people from different cultures.
  • Read more about me and my achievements at: https://ganeshsanapblogs.wordpress.com/about MCT | SharePoint, Microsoft 365 and Power Platform Consultant | Contributor on SharePoint StackExchange, MSFT Techcommunity
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Founder of SKILLFUL SARDINE, a company focused on productivity and the Power Platform. You can find me on LinkedIn: https://linkedin.com/in/manueltgomes and twitter http://twitter.com/manueltgomes. I also write at https://www.manueltgomes.com, so if you want some Power Automate, SharePoint or Power Apps content I'm your guy 🙂
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 15 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • Big fan of Power Platform technologies and implemented many solutions.
  • Passionate #Programmer #SharePoint #SPFx #M365 #Power Platform| Microsoft MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – https://kamdaryash.wordpress.com Youtube channel - https://www.youtube.com/channel/UCM149rFkLNgerSvgDVeYTZQ/