Checking for existence of an item in the collection from Turn State, in Microsoft Bot Framework's If BoolExpression Condition-what expression to use?

Viewed 39

We are using Microsoft Bot Framework 4.12, C#, .NET Core 3.1 as part of a conversational bot implementation.

Trying to access a collection in turn state in a If condition memory expression (BoolExpression). Tried the "contains(turn.orderids, 2)" in the Condition expression - but it is not resolving with the turnstate shown in the figure. Any thoughts on the expression to use? Clearly I am not using the correct expression.

Thank you

Athadu

new IfCondition()
{
    Condition = "contains(turn.orderids, 2)",
    Actions = new List<Dialog>()
    {
        new SendActivity("Order 2 found"),
    },
    ElseActions = new List<Dialog>
    {
        new SendActivity("Order 2 NOT found"),
    }
},

enter image description here

1 Answers

Have you tried "=contains(turn.orderids, 2)"? Note the = sign before the condition.

Related