Skip to main content
Skip table of contents

User input based continuation

Conversations can adapted based on input from the user. This can be done by combining a few steps:

  1. Use a text to let the user know they are expected to give input.

  2. Retrieve the input via an input or a combination of listpicker / reply buttons with an input .

  3. Decide on how to move forward with the conversation via a logic .

Or you use the menu step which gathers all this functionality into one (meta) step. The example below shows how this would look like.

YAML
config:
  conversationOwner: null
  conversationOwners:
    - identifier: conversationOwner
      channel: WhatsApp
  scriptLanguageVersion: 1
  scriptVersion: 1
  defaultDelay: 200
  lists:
    positive-answers:
      items:
        - Ja
    negative-answers:
      source: negative-answers.yml

flows:
  - id: main
    description: Entry flow for the bot
    steps:
      - !entry
        id: Entry-1
        actions: []
        clientActions: []
        matches: []
        regexMatches:
          - dennis
        allowRestart: true
        isCaseSensitive: true
        doCatchAll: false

      - !menu
        id: Menu-1
        actions: []
        clientActions: []
        displayType: ListPicker
        header: Subject choice
        interactiveMessageBody: What are you looking for?
        buttonTitle: ''
        footer: ''
        options:
          - key: shoes
            keyAliases: []
            contentType: PlainText
            displayedText: Shoes
            cursor: info-shoes.Text-1
          - key: sweaters
            keyAliases: []
            contentType: PlainText
            displayedText: Sweaters
            cursor: info-sweaters.Text-1
        fallback: You didn't provide a valid option.
        timeoutInSeconds: ''
        timeoutCursor: ''

  - id: info-shoes
    description: ''
    steps:
      - !text
        id: Text-1
        actions: []
        clientActions: []
        message: >-
          We have a lot of options when it comes to shoes. Especially within the sneakers branch we are well equipped.
      - !end_session
        id: Terminate-1
        actions: []
        clientActions: []
        resetRouter: false

  - id: info-sweaters
    description: ''
    steps:
      - !text
        id: Text-1
        actions: []
        clientActions: []
        message: We have some sweaters in our stores but most have are sold out.
      - !end_session
        id: Terminate-1
        actions: []
        clientActions: []
        resetRouter: false

All steps mentioned above can be found in our Steps documentation.


Previous: examples Intro

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.