> ## Documentation Index
> Fetch the complete documentation index at: https://help.dingtalk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# UNIONSET

> UNIONSET函数用于获取两个集合的并集，支持在宜搭的不同场景中使用，如表单、流程设计等。该函数需要指定两个数组作为参数，并返回成员的userid列表。

**UNIONSET**函数用于获取两个集合的并集。

## 支持产品场景

UNIONSET函数支持在宜搭的以下场景中使用。

* 表单（业务关联规则）
* 表单（校验）
* 流程设计（校验规则）
* 流程设计（关联操作）
* 集成自动化
* 流程-节点
* 连接器

## 格式

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
UNIONSET(arrayA,arrayB)
```

## 属性说明

<table>
  <tr>
    <td>**属性**</td>
    <td>**是否必填**</td>
    <td>**说明**</td>
  </tr>

  <tr>
    <td>arrayA</td>
    <td>是</td>
    <td rowSpan={2}>需要计算并集的集合，多个集合之间使用英文逗号分隔。<br />**说明**：目前仅支持计算成员组件的并集。不支持在子表单中使用。</td>
  </tr>

  <tr>
    <td>arrayB</td>
    <td>是</td>
  </tr>
</table>

## 返回值

| **返回值类型** | **说明**       |
| --------- | ------------ |
| 数组        | 成员的userid列表。 |

## 使用示例

如下图所示，使用`UNIONSET()`和`EMPLOYEE()`函数计算两个成员组件的并集。

<Frame>
  ![](https://yida-support.oss-cn-shanghai.aliyuncs.com/static/gif/1704361486988-504f5612-1766-43f2-b20f-c9228bd2436e.gif)
</Frame>
