How to "chain" variables for confirmation

In autopilot I have a "simple" task (copied from a Twilio example) an action "say" then collect with 2 questions.

How can I get the answer from question 1(schedule_open_house) into the confirm of question 2 (schedule_open_house_time) - here's my modified JSON - which "naturally" does not work - must be possible? IF NOT how do I access the variables in a new task? - Thanks

{
"actions": [
{
"say": "Okay lets do this. I just need to ask few questions."
},
{
"collect": {
"name": "schedule_open_house",
"questions": [
{
"question": "What date do you want to come visit?",
"prefill": "schedule_open_house_date",
"name": "schedule_open_house_date",
"type": "Twilio.DATE"
},
{
"question": "Thanks, what time would you like to come in?",
"prefill": "schedule_open_house_time",
"name": "schedule_open_house_time",
"type": "Twilio.TIME",
"confirm": {
"on_confirm": {
"say": "Perfect, let's continue"
},
"max_attempts": {
"redirect": "task://fallback",
"num_attempts": 2
},
"messages": [
{
"say": "I heard you want to come in on {schedule_open_house_date} at {schedule_open_house_time}. Is that correct?"
},
{
"say": "Did you mean to say you want to come in on {schedule_open_house_date} at {schedule_open_house_time}. Is that correct?"
}
],
"on_reject": {
"messages": [
{
"say": "I'm sorry, let's try again. When do you want to come in?"
},
{
"say": "My bad, can you tell me again when you want to come in?"
}
]
}
}
}
],
"on_complete": {
"redirect": "task://complete_booking"
}
}
}
]
}

Tagged:

Answers

Sign In or Register to comment.