BotFramework-Composer icon indicating copy to clipboard operation
BotFramework-Composer copied to clipboard

LG for 'choices' field in multi choice input results in Warning

Open carlosscastro opened this issue 4 years ago • 1 comments

Repro bot attached.

I defined an option set as bot responses for YesNo() as shown in the image below

image

Then, I add a multi choice input which uses ${YesNo()} as array of choices

image

When doing this, I get a warning in composer

image

However, this usage should be correct and is even contemplated in the ChoiceInput code in the SDK:

 if (Choices.ExpressionText != null && Choices.ExpressionText.TrimStart().StartsWith("${", StringComparison.InvariantCultureIgnoreCase))
            {
                // use ITemplate<ChocieSet> to bind (aka LG)
                return await new ChoiceSet(Choices.ExpressionText).BindAsync(dc, dc.State).ConfigureAwait(false);
            }
            else
            {
                // use Expression to bind
                return Choices.TryGetValue(dc.State).Value;
            }

The code excerpt is from here: https://github.com/microsoft/botbuilder-dotnet/blob/main/libraries/Microsoft.Bot.Builder.Dialogs.Adaptive/Input/ChoiceInput.cs#L236

Seems like the Choices field is ObjectExpression but should allow LG in the UI canvas.

carlosscastro avatar May 04 '22 20:05 carlosscastro

Repro bot: Empty_export.zip

carlosscastro avatar May 04 '22 20:05 carlosscastro