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.
- In the
#listparks
node, change the response text to use the following SpEL expression:
I can tell you about <? $parks ?>
- 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. - Modify the response to use a join expression:
I can tell you about <? $parks.join(', ') ?>
- In the Chat pane, enter
show me a list of parks
.
The response is now formatted nicely.