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 .

agg(customer.labels).getLabelValue('posts_number') > 10
  • To give effect, e.g. for a transaction within 5 days of a given date:

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

86400 represents the total number of seconds in a day.

Last updated