Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Planner
    • Outlook
    • SharePoint
    • Teams
  • Triggers
  • Resources
  • ABOUT ME
  • Get help with your flow
Menu

Convert Forms multiple choice into Planner checklist (Power Automate)

Posted on February 16, 2022February 16, 2022 by Tom

“I’d like to convert the multiple choice response from MS Forms into a Planner task checklist, is that possible with Power Automate?”


Working with the Forms in Power Automate is always challenging. The reason is that Forms gives you all the responses as a string. It doesn’t matter if it’s a number, date, or an array with choices, everything is a string. And if you use it as it is, Power Automate will process it as a single text value.

Unless you want to create a single checklist item with all the selected choices in the title, you must convert it.

Power Automate Forms Planner checklist

Turn the string into an array

The first step is to convert the array-looking string into an actual array. It’s the only way how you can later loop through all the choices and create multiple checklist items.

As already described in the previous article, the fastest way is to use the json(…) expression.

json(<FormsMultipleChoiceQuestion>)

You can even use it directly as an input of an ‘Apply to each’ action where you’ll process the choices one by one.

Build the checklist items array

But to add the checklist items you’ll need a more complex array than just the choices. A new array variable to fill in the loop.

The array must have a specific format that you have to follow, and which you can get using a dummy checklist item.

{
    "id": "<checklist item ID>",
    "title": "<checklist item title>",
    "isChecked": false
}

At this moment you have the title (the current loop item) and the isChecked information (that’ll be always false). But you’re missing the id. The id must be unique so you can’t use some fixed number and there’s no source for id’s as when using a SharePoint list. You’ll have to create a random id for each of the checklist items. That’s a job for the rand(…) expressions.

rand(<lowestNumber>, <highestNumber>)

The rand(…) expression will give you a random number between the two numbers used as parameters. For example, the expression below will give you a random number between 0 and 1,000,000.

rand(0,1000000)

Now, with all the pieces of information, you can add ‘Append to array variable’ in the loop and build the array with checklist items.

Power Automate Forms Planner checklist

All that’s left is to update the Planner task with the checklist items.

Power Automate Forms Planner checklist

Summary

Converting Forms multiple choice question into Planner task checklist with Power Automate takes a few steps. Firstly, you must convert the responses from string into an array. Once you have the array you can loop through all the choices, and with the help of the rand(…) expression create an array in the right format. After the loop, after all the checklist items are ready, update them to the Planner task.


Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

2 thoughts on “Convert Forms multiple choice into Planner checklist (Power Automate)”

  1. Ben says:
    February 18, 2022 at 6:33 pm

    I was just working on this problem this week (converting a stringified array from Forms back into an array), and your idea of using json() is far cleaner than the mess of nested string expressions I had put together!

    I’ll give you a tip in exchange: to generate your checklist id, you can just use guid() instead of rand(). No parameters required.

    Reply
    1. Tom says:
      February 19, 2022 at 11:43 am

      Hello Ben,
      thank you for the tip, I didn’t know that you can use guid() as the id, I thought it has to be a number.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Do you know what to do, but not how to do it?

Get The Ultimate Power Automate expressions cheat sheet and translate your thoughts into flows with ease!


There's also the HTTP requests to SharePoint cheat sheet to help you overcome limitations of some standard actions!

Do you struggle with the various expressions, conditions, filters, or HTTP requests available in Power Automate?

I send one email per week with a summary of the new solutions, designed to help even non IT people to automate some of their repetitive tasks.

All subscribers have also access to resources like a SharePoint Filter Query cheat sheet or Date expressions cheat sheet.

Zero spam, unsubscribe anytime.

  • How to find Excel rows missing in SharePoint list (Power Automate)March 29, 2023
  • Check whether user exists in AAD with Power AutomateMarch 26, 2023
  • How to highlight whole SharePoint row based on calculated dateMarch 22, 2023
  • Why is your Power Automate flow running so slow?March 19, 2023
  • How to add multiple links to the Power Automate approval taskMarch 15, 2023

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2023 Let's POWER Automate | Theme by SuperbThemes