> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/main-features/expressions/sample-use-cases/excluding-members.md).

# Excluding Members

There are pre-made conditions that let you target campaigns to a specific group of users - for example, members with set custom attributes.

<figure><img src="/files/RqfPg9r3YvWWuF61plaJ" alt=""><figcaption></figcaption></figure>

However, there is no predefined condition to exclude a group of users from the campaign. For example, you have a custom attribute called Debt, with two possible values set: true or false. Let it be that you want to set a campaign for all users, but not for those who are in debt with your app. The best way to do so is to create a condition using an expression.\
\
How to do it? To include a customer with a specific custom value, you would use an expression that looks like this:

```
agg(customer.labels).matchLabel('debt', 'true')
```

\
To exclude those users, you have to set the opposite of it, which you can accomplish by adding “!” at the beginning of it:

```
!agg(customer.labels).matchLabel('debt', 'true')
```

<figure><img src="/files/YVjNrWjoO3pUjuvPG3Ir" alt=""><figcaption></figcaption></figure>

This will allow you to create a campaign that affects all users except for those with the custom attribute Debt equal true.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://help.openloyalty.io/main-features/expressions/sample-use-cases/excluding-members.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.
