Ask a question

Great, now you you have the Assistant talking, the next step would be to ask a user a question. You do that by using an action getInput.

Let’s make some changes to our step to include the getInput action.


    - name: My first step
      actions:
        - sendText: >
            Hello, World!
            Do you want a personal greeting?
        - getInput:

First thing you might have noticed - we put the greater than sign > after sendText action. Normally, your script would break, if you put in the new lines in the sendText action. For example, if you do this in your script


    - name: My first step
      actions:
        # WARNING: Following line will break your scenario!
        - sendText: "Hello, World!
        Do you want a personal greeting?"
        - getInput:

and try to save the scenario you will get the following error:

0D9448FE-60A2-4A50-9C50-FE83918CC944-2

The > sign would help you out, if you want to write longer texts to maintain the overview.

Now, after we’ve sent the text to the User - we actually want to make our Assistant listen. That’s what getInput does. On your devices you will usually see some visual cue. On Alexa that will be a blue ring or line. And on Google Home that would be blinking white dots.

That’s how the Human knows - ok, here is where I come in - it’s time for me to say something.

If you launch the Tester now, nothing will change:

6A40CFA0-4038-41AE-9D3E-4FBB6DA6ADB7-2

Why? Well, although you asked the User a question and even put the Assistant in the “listening” mode with getInput, you still haven’t defined two important things:

  1. What are you expecting your user to say?
  2. What would happen next - after she said it?