Search code examples
dialogflow-cx

DialogFlow CX not allowing to reference form parameters in entry fulfillment?


I have a page called shirt_order with two paramteters shirt_size and shirt_color.

As an entry fulfillment for this page I want to have "OK, let's order a shirt. But first I need to have some info from you" if the bot does not yet know the shirt_size and shirt_color from the previous utterance by the user. In case the bot already knows shirt_size and shirt_color from the previous utterance by the suer (i.e. bot received them as intent parameters) the bot should say "OK, let's order a shirt... and luckily I already have all inputs that I need for the order".

So my plan is to enter a conditional response in the entry fulfillment of the shirt_order page. In this condition I want to check whether the form with its two form parameters is already filled as follows:

if $page.params.status = "FINAL" ... I first need to have some inputs form you... else ... I already have all inputs... endif

But the condition $page.params.status = "FINAL" seems to be always false?!?! Same for $page.params.shirt_size.status = "UPDATED". I then tried to just output the text $page.params.shirt_size in the entry fulfillment but that parameter is never filled.

So I have the feeling that in an entry fulfillment of a certain page you are not able to reference the form parameters of the same page because form parameters do not yet exist at the time when the entry fulfillment is alled. Is this really true? This would be quite weak design by Google, right?

Thanks!


Solution

  • Note that you can only use form status references in a condition requirement of a condition route.

    For your use case, instead of using the $page.params.status or $page.params.parameter_name, you can use $session.params.parameter_name on creating your conditional response for your entry fulfillment:

    if $session.params.shirt_color = null OR $session.params.shirt_size = null
       OK, let's order a shirt. But first I need to have some info from you
    else
       OK, let's order a shirt... and luckily I already have all inputs that I need for the order
    endif
    

    Here are the results:

    enter image description here

    enter image description here