Search code examples
jsonwatson-conversation

Adding newline and spacing in watson conversation output (JSON)


I want the watson conversation to give an output like:


I can solve the problems for the following products.

1 Air Conditioner

2 Refrigerator

3 Washing Machine


I am trying the following in JSON. But I am getting all the text cramped together.


{ "output": { "text": "I can solve the problems for the following products.\n\n1\tAir Conditioner\n2\tRefrigerator\n3\tWashing Machine" } }


I have also tried \n and \t which is also unsuccessful. Is there any way to get the text properly spaced in the JSON text tag. (I used the conversation tool to everything)


Solution

  • I found the answer!!

    add

    "br" tags in the simple format of JSON. It is not reflected on the test chat, the change is only reflected on deploying it in an app