How to set up the needed data?

In our case, we are going to fake it. And we will teach you some useful things in the process.

The Custom JS block allows adding custom JavaScript code that can do magic.

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.

globals.first_name = ”Anna Gregorczyk”

My name is Anna Gregorczyk, so I place this name in our example.

globals.date = new Date(2021,05,26,15,30) 

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!

Last updated