Mark, That worked like a champ.
Thanks, Edgardo On Wed, May 6, 2015 at 10:55 AM, Mark Payne <[email protected]> wrote: > Edgardo, > > > Sorry, completely misunderstood the problem. You’re right. > > > The issue is that when you use the “now” function, it has to be the first > thing in the Expression. So to do what you're wanting, you’ll have to embed > a new expression: > > > ${created_at:toDate("yyyy-MM-DD'T'HH:mm:ss.SSS'Z'"):lt( > ${now():minus(3600000)} )} > > > That should do it for you. If not, let me know! > > > Thanks > > -Mark > > > > > > > > > > From: Edgardo Vega > Sent: Wednesday, May 6, 2015 10:51 AM > To: [email protected] > > > > > > Mark, > > The documentation for toDate say that it returns a number so going from a > number to a number doesn't fix the problem. The validation message says it > is invalid because Unexpected token 'now' at line 1.... > > If I type a number say 100 so ${created_at:toDate("yyyy-MM- > DD'T'HH:mm:ss.SSS'Z'"):lt(100)} I validates fine anything else throws a > validation message. > > Cheers, > > Edgardo > > > On Wed, May 6, 2015 at 10:40 AM, Mark Payne <[email protected]> wrote: > > > Edgardo, > > > > > > Try: > > > > > > > > > > > > > > > > > ${created_at:toDate("yyyy-MM-DD'T'HH:mm:ss.SSS'Z'"):toNumber():lt(now():minus(3600000))} > > > > > > > > That toNumber() call will convert the date into milliseconds since epoch. > > That should allow you to easily compare against the other number. > > > > > > Thanks > > > > -Mark > > > > > > > > > > > > > > From: Edgardo Vega > > Sent: Wednesday, May 6, 2015 10:39 AM > > To: [email protected] > > > > > > > > > > > > I am trying to route on attribute and have created a complex expression > but > > I get a validation error. > > > > > > > ${created_at:toDate("yyyy-MM-DD'T'HH:mm:ss.SSS'Z'"):lt(now():minus(3600000))} > > > > It seems like less than function only supports a number not an expression > > or an attribute name. > > > > How can I accomplish what I am trying to do? I am just trying to route > > based if created_at is older than an hour? > > > > Thanks in advance > > > > > > -- > Cheers, > > Edgardo > -- Cheers, Edgardo
