Constraint Builder Expressions
The following list contains specific expressions that can only be used within the manual expression editor of the Constraint Builder in Engage :
- lookup([SCOPENAME], all/any())
Example : lookup([ORDERS],all(eq([CURRENCY], 'euro')),lookup([ORDERLINES],all(gt([QUANTITY], toint('5'))))))
= Lookup if the user has an order (1:N linked list Orders) with currency equal to euro and an orderline (1:N linked list orderlines) for which the quantity is greater than 5.
- linkClickedBefore(journeyid, actionid, linkid, datetime)
Example : linkclickedbefore('1000000115','8','101',todatetime('2018-11-28 16:25:12','yyyy-MM-dd HH:mm:ss'))
- not(linkClickedBefore(journeyid, actionid, linkid, datetime))
Example : not(linkclickedbefore('32929','3','0',todatetime('2018-12-04 10:15:57','yyyy-MM-dd HH:mm:ss')))
- linkClickedAfter(journeyid, actionid, linkid, datetime)
Example : linkclickedafter('1000000115','8','101',addrelativetonow(0,1,5,10))
- not(linkClickedAfter(journeyid, actionid, linkid, datetime))
Example : not(linkclickedafter('32929','3','0',todatetime('2018-12-04 10:16:27','yyyy-MM-dd HH:mm:ss')))
- linkClickedBetween(journeyid, actionid, linkid, datetime, datetime)
Example : linkclickedbetween('1000000115','8','101',todatetime('2018-12-25 16:27:00','yyyy-MM-dd HH:mm:ss'),todatetime('2019-01-01 16:27:00','yyyy-MM-dd HH:mm:ss'))
- not(linkClickedBetween(journeyid, actionid, linkid, datetime, datetime))
Example : not(linkclickedbetween('32929','3','0',todatetime('2018-12-04 10:16:43','yyyy-MM-dd HH:mm:ss'),todatetime('2018-12-04 10:16:43','yyyy-MM-dd HH:mm:ss')))
- linkClicked(journeyid, actionid, linkid)
Example : linkclicked('1000000115','8','106')
- not(linkClicked(journeyid, actionid, linkid))
Example : not(linkclicked('32929','3','0'))
- contentClickedBefore(journeyid, actionid, datetime)
Example : contentclickedbefore('1000000115','21',subrelativetotoday(0,3,10,0))
- not(contentClickedBefore(journeyid, actionid, datetime))
Example : not(contentclickedbefore('32929','3',todatetime('2018-12-04 09:54:09','yyyy-MM-dd HH:mm:ss')))
- contentClickedAfter(journeyid, actionid, datetime)
Example : contentclickedafter('1000000115'.'21',todatetime('2018-11-28 16:43:26','yyyy-MM-dd HH:mm:ss'))
- not(contentClickedAfter(journeyid, actionid, datetime))
Example : not(contentclickedafter('32929','3',todatetime('2018-12-04 09:54:09','yyyy-MM-dd HH:mm:ss')))
- contentClickedBetween(journeyid, actionid, datetime, datetime)
Example : contentclickedbetween('1000000115','21',todatetime('2019-01-01 07:00:00','yyyy-MM-dd HH:mm:ss'),todatetime('2019-02-01 00:00:00','yyyy-MM-dd HH:mm:ss'))
- not(contentClickedBetween(journeyid, actionid, datetime, datetime))
Example : not(contentclickedbetween('32929','3',todatetime('2018-12-04 09:59:43','yyyy-MM-dd HH:mm:ss'),todatetime('2018-12-04 09:59:43','yyyy-MM-dd HH:mm:ss')))
- contentClicked(journeyid, actionid)
Example : contentclicked('1000000115','21')
- not(contentClicked(journeyid, actionid))
Example : not(contentclicked('32929','3'))
- contentSentBefore(journeyid, actionid, datetime)
Example : contentsentbefore('1000000115','21',addrelativetotoday(0,7,0,0))
- not(contentSentBefore(journeyid, actionid, datetime))
Example : not(contentsentbefore('32929','3',todatetime('2018-12-04 10:01:30','yyyy-MM-dd HH:mm:ss')))
- contentSentAfter(journeyid, actionid, datetime)
Example : contentsentafter('1000000115','21',todatetime('2017-01-05 00:00:00','yyyy-MM-dd HH:mm:ss'))
- not(contentSentAfter(journeyid, actionid, datetime))
Example : not(contentsentafter('32929','3',todatetime('2018-12-04 10:01:45','yyyy-MM-dd HH:mm:ss')))
- contentSentBetween(journeyid, actionid, datetime, datetime)
Example : contentsentbetween('1000000115','21',subrelativetonow(12,0,0,0),todatetime('2019-01-01 10:30:00','yyyy-MM-dd HH:mm:ss'))
- not(contentSentBetween(journeyid, actionid, datetime, datetime))
Example : not(contentsentbetween('32929','3',todatetime('2018-12-04 10:01:59','yyyy-MM-dd HH:mm:ss'),todatetime('2018-12-04 10:01:59','yyyy-MM-dd HH:mm:ss')))
- contentSent(journeyid, actionid)
Example : contentsent('1000000115','21')
- not(contentSent(journeyid, actionid))
Example : not(contentsent('32929','3'))
- contentViewedBefore(journeyid, actionid, datetime)
Example : contentviewedbefore('1000000115','21',todatetime('2018-06-06 16:54:00','yyyy-MM-dd HH:mm:ss'))
- not(contentViewedBefore(journeyid, actionid, datetime))
Example : not(contentviewedbefore('32929','3',todatetime('2018-12-04 10:03:59','yyyy-MM-dd HH:mm:ss')))
- contentViewedAfter(journeyid, actionid, datetime)
Example : contentviewedafter('1000000115','21',todatetime('2018-12-06 23:55:00','yyyy-MM-dd HH:mm:ss'))
- not(contentViewedAfter(journeyid, actionid, datetime))
Example : not(contentviewedafter('32929','3',todatetime('2018-12-04 10:04:13','yyyy-MM-dd HH:mm:ss')))
- contentViewedBetween(journeyid, actionid, datetime, datetime)
Example : contentviewedbetween('1000000115','21',todatetime('2010-01-01 00:00:00','yyyy-MM-dd HH:mm:ss'),todatetime('2019-01-01 00:00:00','yyyy-MM-dd HH:mm:ss'))
- not(contentViewedBetween(journeyid, actionid, datetime, datetime))
Example : not(contentviewedbetween('32929','3',todatetime('2018-12-04 10:04:27','yyyy-MM-dd HH:mm:ss'),todatetime('2018-12-04 10:04:27','yyyy-MM-dd HH:mm:ss')))
- contentViewed(journeyid, actionid)
Example : contentviewed('1000000115','21')
- not(contentViewed(journeyid, actionid))
Example : not(contentviewed('32929','3'))
- contentDeliveredBefore(journeyid, actionid, datetime)
Example : contentdeliveredbefore('1000000115','21',addrelativetonow(0,0,25,30))
- not(contentDeliveredBefore(journeyid, actionid, datetime))
Example : not(contentdeliveredbefore('32929','3',todatetime('2018-12-04 10:02:47','yyyy-MM-dd HH:mm:ss')))
- contentDeliveredAfter(journeyid, actionid, datetime)
Example : contentdeliveredafter('1000000115','21',todatetime('2018-11-28 17:00:00','yyyy-MM-dd HH:mm:ss'))
- not(contentDeliveredAfter(journeyid, actionid, datetime))
Example : not(contentdeliveredafter('32929','3',todatetime('2018-12-04 10:03:06','yyyy-MM-dd HH:mm:ss')))
- contentDeliveredBetween(journeyid, actionid, datetime, datetime)
Example : contentdeliveredbetween('1000000115','21',subrelativetonow(24,0,0,0),addrelativetonow(11,0,0,0))
- not(contentDeliveredBetween(journeyid, actionid, datetime, datetime))
Example : not(contentdeliveredbetween('32929','3',todatetime('2018-12-04 10:03:22','yyyy-MM-dd HH:mm:ss'),todatetime('2018-12-04 10:03:22','yyyy-MM-dd HH:mm:ss')))
- contentDelivered(journeyid, actionid)
Example : contentdelivered('1000000115','21')
- not(contentDelivered(journeyid, actionid))
Example : not(contentdelivered('32929','3'))
- datepartisequal (*)
Example : datepartisequal([MASTER.BIRTH_DAY],todatetime('2000-01-01 12:13:14', 'yyyy-MM-dd hh:mm:ss'), '')
- datepartisnotequal (*)
Example : datepartisnotequal([MASTER.BIRTH_DAY],todatetime('2000-01-01 12:13:14', 'yyyy-MM-dd hh:mm:ss'), 'year')
- datepartisbefore (*)
Example : datepartisbefore([MASTER.BIRTH_DAY],todatetime('2000-01-01 12:13:14', 'yyyy-MM-dd hh:mm:ss'), 'month')
- datepartisbeforeorequal (*)
Example : datepartisbeforeorequal([MASTER.BIRTH_DAY],todatetime('2000-01-01 12:13:14', 'yyyy-MM-dd hh:mm:ss'), 'day')
- datepartisafter (*)
Example : datepartisafter([MASTER.BIRTH_DAY],todatetime('2000-01-01 12:13:14', 'yyyy-MM-dd hh:mm:ss'), 'hour')
- datepartisafterorequal (*)
Example : datepartisafterorequal([MASTER.BIRTH_DAY],todatetime('2000-01-01 12:13:14', 'yyyy-MM-dd hh:mm:ss'), 'monthday')
- datepartisbetween (*)
Example : datepartisbetween([MASTER.BIRTH_DAY],todatetime('2000-01-01 12:13:14', 'yyyy-MM-dd hh:mm:ss'), '')
(*) The last parameter of all the datepart expressions must be one of the following :
- empty (2 single quotes) — This means a full date comparison
- year
- month
- day
- hour
- monthday
Note: To support Campaign specific interactions (legacy), an equivalent of the above expressions is used, prefixed with 'cpg' (such as cpglinkclicked, cpgcontentdeliveredbefore, etc).
Note: DateTime can be absolute or relative.
Expressions on relative dates/datetimes can be used as follows :
- DateTime :
subrelativetonow(week, day, hour, minute)
addrelativetonow(week, day, hour, minute)
addrelativedateparttonow(year, month, day, hour)
- Date :
subrelativetotoday(week, day, hour, minute)
addrelativetotoday(week, day, hour, minute)
Some examples of combinations of relative date comparisons :
- datepartisbetween([MASTER.BIRTH_DAY],subrelativedateparttonow(1,2,3,4), addrelativedateparttonow(5,6,7,8), '')
- datepartisnotequal([MASTER.BIRTH_DAY], subrelativetotoday(0,0,5,0),'')
- datepartisafterorequal([MASTER.BIRTH_DAY], addrelativetonow(0,0,5,0),'')
- datepartisequal([MASTER.BIRTH_DAY], addrelativetotoday(0,0,5,0),'')
Note: General Engage expressions that can be used can be found here.