使用 'Common Expression Language',如何在集合中添加 count/query 元素

Using the 'Common Expression Language', how do I count/query elements in a collection

我正在尝试使用 Bot Samples Common Expression Languag 计数并查询 JSON 响应中的元素。

我使用的是Bot Framework Composer in a standard response after using a GET to fetch the JSON response as in the Weather example tutorial中的表达语言。

我的 JSON 回复示例:

{
    "result": [
        {
            "number": "item 1"
        },
        {
            "number": "item 2"
        },
        {
            "number": "item 3"
        }
    ]
}

发送回复 任务中使用的无效内容示例: - 如何计算结果对象中的元素?

- @{count(dialog.result.result)}
- @{dialog.result.result[0].number}

我们将高度推荐此类操作的一些示例。

糟糕,我的 JSON 响应结果与示例中的不同。我自己介绍了一个问题,但没有注意到它已经改变了。所以,我的例子,计数等实际上工作正常。