Use expressions

You can use SpEL to create expressions in Watson Conversation responses by using the following syntax . Now, you’ll use expressions to clean up the response.

  1. In the #listparks node, change the response text to use the following SpEL expression:
    I can tell you about <? $parks ?>
  2. Again, test the response of list parks in the Chat pane.
    Note that it behaves exactly the same. There is no change to the response.
  3. Modify the response to use a join expression:
    I can tell you about <? $parks.join(', ') ?>
  4. In the Chat pane, enter show me a list of parks.
    The response is now formatted nicely.