# 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: 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/using-member-custom-attributes.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.
