'OR condition not working in Dialogflow CX

I have an intent that contains several parameters. I established a route that should be activated when the first parameter OR the second one is not empty:

$intent.params.tipo3.resolved : "" OR $intent.params.valutarapporti.resolved : ""

If either one of the parameter is not empty, then the agent should transit to another page.

The problem is that is only works when the first parameter is not empty; if the first one is empty but the second one is not, the transition does not happen. It seems like the condition "OR" is misfunctioning.

Note that the parameter is correctly recognized: the user says something that matches the correct intent, the parameter "valutarapporti" is recognized but then no transition happens.

If I separate the two conditions in two different routes, obviously it works, but I'd like to have a single route for such a simple thing. I tried setting them as session parameters, but the results does not change (and that's not really the issue: like I said, the parameter is recognized, the problem is with the transition).



Solution 1:[1]

To define a condition when only one intent parameter is set, but not both, you can use the following:

$intent.params.tipo3.resolved = null OR $intent.params.valutarapporti.resolved = null

In this case, you may need to define a separate condition for a situation when both parameters are set.

To define a condition when either one of the two intent parameters is set or both parameters are set, you can use the following:

$intent.params.tipo3.resolved != null OR $intent.params.valutarapporti.resolved != null

Solution 2:[2]

The answer posted by Svetlana solved my problem; I'll add that I also tried to define the condition as

$intent.params.tipo3.resolved != "" OR
$intent.params.valutarapporti.resolved != ""

and that solved my immediate problem. However, it meant that the route with this condition was always valid and the other routes were never even evaluated.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Svetlana
Solution 2 joanis