Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

System function $sys.func.IS_PAST_DATE not working for conditional route

I am trying to create a route that triggers if the session time is greater than x minutes in DialogFlow CX. I have a conditional route with customized expression $sys.func.IS_PAST_DATE($session.params.endtime) and it is not working. The parameter endtime was set at the beginning of the session with $sys.func.ADD_DATE($sys.func.NOW(), X, "MINUTES") and I verified it is correct. It just seems function IS PAST DATE is not returning true or false as expected.

0 1 347
1 REPLY 1

Hi, 

for IS_PAST_DATE function, the date or datetime object should either be of a date or datetime-related entity type (such as @sys.date, and @sys.date-time) or an object with some or all of the following fields:

  • year
  • month
  • day
  • hours
  • minutes
  • seconds
  • nanos

Check the docs here: https://cloud.google.com/dialogflow/cx/docs/reference/system-functions#func-ispastdate

so probably it will not work in the way you were expecting (using a parameter set in a webhook).

Best,

Xavi