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:
SharePoint List:
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.
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:
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’.
Step 2: Add the ‘Delay‘ action to your Power Automate so that we can wait for responses to be updated in Excel.
Step 3: Initial a variable of type ‘String‘ and Name is ‘Email‘ and another variable of type ‘Array‘ and Name ‘Sample Array‘.
Step 4: Add the Excel Online (Business) ‘Get a row’ action.
Note: It will automatically add a ‘Apply to each‘ loop around the action.
Step 5: Transform 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'],';')
Step 8: Add the ‘Filter array‘ action.
Explanation:
Step 9: Add the ‘Select‘ action to the.
Explanation: This will transform the array in format that is accepted by SharePoint Multiple Choice .
Step 10: Set the ‘Sample Array‘ variable value to output of the ‘Select‘ action.
Step 11: Set the ‘EmailAddress‘ variable value to ‘Email‘ of the output of the Excel ‘Get a row’ action.
Step 12 : Outside the ‘Apply to each loop‘, add the SharePoint ‘Create item‘ action.
All done!
Thank you for reading 🙂
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.