# UNION (or |)

### Description

The UNION function combines the elements of two sets into one single set. You can also use the infix operator | to achieve the same.

### Example

```
p is Person
UNION(p.services_accepted, p.services_declined)
```

The set of services offered to this client will list both the offers the client accepted, plus those that were offered but declined.

Using the infix operator, the same example would look like

```
p is Person
p.services_accepted | p.services_declined
```

{% hint style="info" %}
**New in Atfinity 17:** The `|` operator can also be used to merge dictionaries. See [`merge_dicts`](/rule-language/operators/dictionary-operators/merge_dicts.md).
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/operators/list-operators/union.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
