# How to output text by Watson Assistant

**URL:** <https://discourse.nodered.org/t/how-to-output-text-by-watson-assistant/2673>\
**Category:** General\
**Created:** [29 August 2018 18:19 UTC](https://discourse.nodered.org/t/how-to-output-text-by-watson-assistant/2673 "2018-08-29T18:19:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![labs180](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/labs180/32/2148_2.png) [@labs180](https://discourse.nodered.org/u/labs180)\
**Post date:** [29 August 2018 18:19 UTC](https://discourse.nodered.org/t/how-to-output-text-by-watson-assistant/2673/1 "2018-08-29T18:19:13Z")

</div>

I want to use Watson Assistant to input text and print answers in Node-RED.  
The Watson Assistant module is saved in "context", and I don't know how to print it.  
I have placed the function module as shown in the illustration, so please advise me how to configure the function.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/e/e35705b3770e2b8e8128ab0a93fe0fd985285ae7.png)

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 August 2018 19:17 UTC](https://discourse.nodered.org/t/how-to-output-text-by-watson-assistant/2673/2 "2018-08-29T19:17:14Z")

</div>

By "print it" i assume you mean to the debug?

If so you should be able to move it from where it is stored to msg.payload.  
You can do this with a function node (see [https://nodered.org/docs/writing-functions#storing-data](https://nodered.org/docs/writing-functions#storing-data))  
e.g.

```auto
msg.payload = context.get('count')

```

or by using a change node.

But you will need to know the variable name it is stored in.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [29 August 2018 19:28 UTC](https://discourse.nodered.org/t/how-to-output-text-by-watson-assistant/2673/3 "2018-08-29T19:28:15Z")

</div>

Given that flow, I'm not sure `The Watson Assistant module is saved in "context",` means context as we know it. The WA node has its own option to store conversation context in the node - which is not 'context' in the Node-RED sense.

@labs180 it is not completely clear what you want to do. Passing the output fo the WA node to Debug will show you the structure of the message it sends. You can then use that to identify what parts of the message you want to access.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [29 August 2018 21:00 UTC](https://discourse.nodered.org/t/how-to-output-text-by-watson-assistant/2673/4 "2018-08-29T21:00:40Z")

</div>

You may also need to set the debug node to see complete msg rather than just msg.payload.
