List.Single

Syntax

List.Single(list as list) as any  

About

如果列表中 list只有一个项目,则返回该项。 如果有多个项或列表为空,该函数将引发异常。

示例 1

在列表中 {1}查找单个值。

用法

List.Single({1})

输出

1

示例 2

在列表 {1, 2, 3} 中找到单个值。

用法

List.Single({1, 2, 3})

输出

[Expression.Error] There were too many elements in the enumeration to complete the operation.