Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
343 views
in Technique[技术] by (71.8m points)

Dialogflow CX: How to use a session parameter as a form parameter?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I don't know if I fully grasped your question: this is what I understood.

  1. You have some session.params which are always present -> you state them in the entry dialogue.
  2. You also have session.params which are sometimes present -> you want to know how to state them in dialogue only when they're filled.

If this is the case I would probably come up with two solutions:

OPTION 1 Let's say the page is named Recap. As an entry dialogue to Recap you can add what you wrote in the first bullet: "So far I know that $session.params.something and $session.params.something-else".

Then I'd add two separate conditional routes:

  1. The first checks whether the optional parameters have all been filled. If some optional params have been filled you can add a fulfillment here stating this optionals before going to the next page. route

  2. The second just goes to the next page, because the $session.params.optional will be null: pay attention to put them in this order!

OPTION 2 A second option could be to build your own conditional response: so go to Entry dialogue, then add dialogue option, then conditional response. This block allows you to write your own conditions, for example:

if $session.params.optional != null
  So far I know that $session.params.something and $session.params.something-else. I also know that $session.params.optional
else
  So far I know that $session.params.something and $session.params.something-else.
endif

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...