> 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/implementation-guide/integrations-and-data-exchange/expressions/sample-use-cases/using-member-custom-attributes.md).

# Using Member Custom Attributes

In order to provide users with more flexibility in performing Campaign actions, it is possible to use a member's Custom Attributes as a condition in the Campaign. Depending on the value provided in the Custom Attributes we can also perform various operations on the stored data

These types of data are supported:

* datetime, e.g. `2022-12-20T14:15:22+01:00`
* number, e.g. `10.2`
* string, e.g. `featured`

We can use it in the following scenarios:

* In order to retrieve the given custom attribute.\
  In this example, the function will return a value of the key `post_date`.

```
agg(customer.labels).getLabelValue('post_date')
```

* In order to parse the custom attribute to date use function `to_date`

```
to_date(agg(customer.labels).getLabelValue('post_date'))
```

* In order to compare dates use `timestamp()`

```
timestamp(to_date(agg(customer.labels).getLabelValue('post_date')))
```

* To compare numerical values you do not have to use any functions. \
  Remember to use dot separator `.`&#x20;

```
agg(customer.labels).getLabelValue('posts_number') > 10
```

* To give effect,  e.g. for a transaction within 5 days of a given date:

{% code overflow="wrap" %}

```
(timestamp(transaction.purchasedAt) - timestamp(to_date(agg(customer.labels).getLabelValue('post_date')))) <= 86400 * 5
```

{% endcode %}

{% hint style="info" %}
86400 represents the total number of seconds in a day.
{% endhint %}


---

# 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 following URL with the `ask` and `goal` query parameters:

```
GET https://help.openloyalty.io/implementation-guide/integrations-and-data-exchange/expressions/sample-use-cases/using-member-custom-attributes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
