How to set up the needed data?
Last updated
Last updated
In our Conversation Flow Scenario we want a voicebot to confirm a dental appointment. In real life, we would set up an API option in the Start call or use an API block to get the data from your dentist’s IT system.
In our case, we are going to fake it. And we will teach you some useful things in the process.
It sounds like this is a solution only for programmers.
No!
If you know a few tricks, you can reuse ready-made code snippets. You can copy them and use them.
So, let us now simulate, that the voicebot received your data from the dentist’s IT system. We will set this data manually.
Set a global variable that stores names so the voicebot knows your name.
My name is Anna Gregorczyk, so I place this name in our example.
I also set the date of the dentist appointment, which has been planned for 26 of June 2021 at 15:30.
Notice that in Java Script, months are counted from 0, so January is 0, and 05 is June (not May!)
You must remember to put return out1()
as the last line of the code. This makes the Custom JS block return its output to the next block.
Remember to connect the Start Call block to the Custom JS block by a connector!