Microsoft Flow Button Multi-Select Input
Microsoft Flow buttons are very powerful tools to create an app to get information from people in your organization.
One of the input option types is a text input. In addition to the single text field input, you can configure the input field to support both a drop-down list of options and a multi-select version.
For those of that work with the CDS platform and are accustomed to working with the Multi-select option sets there, the Flow implementation behaves differently.
The difference being is that if you try to consume the output of the Flow multi-select selections, Flow treats them as multiple different responses. And as such when the next action to use them follows it will automatically create an apply to each loop, creating one new record for each of the items selected as follows.
In this example rather than create one Contact record with their favorite colors, it will create a Contact for each favorite color with that color as their only favorite.
Here is one way to set it up so that you end up with one Contact record with all their favorite colors in one field.
In order to be able to use the selected options as the input for a single field in CDS, you must first initialize a variable and then concatenate the responses. For simplicity purposes for the blog I am illustrating the steps with the Action being a send mobile notification so you can easily see the results.
Step 1 – Create the Button with a Multi-select option set input
Step 2 – Initialize Favorites Variable. Set the Type to String and leave the value blank.
Step 3 – Use the Concatenate data operation to create a single string value for all the selected options
Step 4 – Lastly insert an action to do ‘something’ with the variable. In the text field just use the Dynamic Content from the previous step. As mentioned previously since I am just blogging and testing with this design pattern, the best practice is to just use the Notification Action for any easy check that the results are there. Once it passes then replace the Notification step with the Action that you will really use.
Ta Da!!!! – Now view the output. In this example I had selected Go Water Skiing and Drive the boat while other people ski in the button input. You don’t think I would have picked reality TV shows or clean my gutters?
Now use this design pattern with any service that flow supports!