cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sarah_Bull
Level: Powered On

How to populate options in "Post a choice of options as the Flow bot to a user"

I am using the action "Post a choice of options as the Flow bot to a user". I want the choices to dynamically populate from a text string array, so that if the array is ["Dog", "Cat", "Fish"], then the user will see the Flow bot ask them to choose one of "Dog", "Cat", or "Fish".

 

Here is a screenshot:

Screen Shot 2019-07-14 at 9.44.03 am.png

The PeekCode is:

"UserMessageWithOptionsSubscriptionRequest/body/options": [
"@variables('ArrayInitial')"
],
 
This interprets the array as a single text string, instead of multiple options. That means that the Flow Bot is posting one single option of "Dog, Cat, Fish", instead of different choices.
 
When I try putting in the array without brackets, I get this error: "OpenApiOperationParameterValidationFailed. The 'inputs.parameters' of workflow operation 'Post_a_choice_of_options_as_the_Flow_bot_to_a_user_2' of type 'OpenApiConnectionWebhook' is not valid. Error details: The API operation does not contain a definition for parameter 'UserMessageWithOptionsSubscriptionRequest/body/options'."
 
How can I get the Flow Bot to correctly grab the list of options from an array?
 
Thank you for your help!
1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to populate options in "Post a choice of options as the Flow bot to a user"

Hi @Sarah_Bull ,

 

Could you provide screenshoot of Flow configuration?

I did a test on my side and can configure the array directly in Options.

Add mutiple-select list of options to Button and create an array based on the user's choice.

2.PNG

Configure the array in Options field, and the options selected by the user will be displayed in the message.

3.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 REPLIES 5
Highlighted
Super User
Super User

Re: How to populate options in "Post a choice of options as the Flow bot to a user"

Hi Sarah @Sarah_Bull , it will always only see the output of the array as a single option because you've only populated 1 option field. You would need to have 3 string variables and then use the output of each variable as an option. I've just manually populated the variables with Dog, Cat and Fish, whereas depending on what other actions you have you might initialize the variables with a blank value then use the action "Append to string variable" to set the value. If you post up the rest of your Flow we could advise on that, but for now my Flow and the result is shown below.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

 

1-Flow.png2-ResultinTeams.png

Sarah_Bull
Level: Powered On

Re: How to populate options in "Post a choice of options as the Flow bot to a user"

Thanks, @RobElliott, that's helpful. What I want to automate is a dynamic length, however, so I want the number of options to vary per run.

 

The workflow is:

  1. Get the options from a spreadsheet (number of options varies per Flow run)
  2. Post the options to the user
  3. User selects an option
  4. The selected option is then processed

I could use a condition to account for each possible number of options, but that seems inelegant.

Super User
Super User

Re: How to populate options in "Post a choice of options as the Flow bot to a user"

If the number of options will vary on each occasion then I think you will need to consider using parallel branching or switch cases as you can't initialize a variable on the fly. What is the maximum number of options that you will wish to present to your users?

Rob
Los Gallardos

Community Support Team
Community Support Team

Re: How to populate options in "Post a choice of options as the Flow bot to a user"

Hi @Sarah_Bull ,

 

Could you provide screenshoot of Flow configuration?

I did a test on my side and can configure the array directly in Options.

Add mutiple-select list of options to Button and create an array based on the user's choice.

2.PNG

Configure the array in Options field, and the options selected by the user will be displayed in the message.

3.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Sarah_Bull
Level: Powered On

Re: How to populate options in "Post a choice of options as the Flow bot to a user"

Thanks, Barry!

 

Could you show me your 'Peek Code' for the options population? I am finding that your method sometimes works and sometimes it doesn't, and I'm having a hard time understanding why this occurs in different circumstances.

Helpful resources

Announcements
firstImage

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 92 members 4,340 guests
Please welcome our newest community members: