dialogflow-cx

DialogFlow CX inline system functions not working


I am trying to use system function for dynamic response but its not working.

$sys.func.IF("$session.params.firstname = null", "admin", $session.params.firstname)

Here in both the case i am getting same response. If session param is null than it is not working.

Is there any other approach to solve this.

I tried condition response but not worked.


Solution

  • If $session.params.firstname can be null, calling it directly in an inline function won't work correctly. Check null value as follows.

    BEFORE:

    $sys.func.IF("$session.params.firstname = null", "admin", $session.params.firstname)
    

    AFTER:

    $sys.func.IF("$sys.func.TO_TEXT($session.params.firstname) = null", "admin", $session.params.firstname)