• United States
IBM?
  • Site map
IBM?
  • Marketplace

  • Close
    Search
  • Sign in
    • Sign in
    • Register
  • IBM Navigation
IBM Developer Answers
  • Spaces
    • Blockchain
    • IBM Cloud platform
    • Internet of Things
    • Predictive Analytics
    • Watson
    • See all spaces
  • Tags
  • Users
  • Badges
  • FAQ
  • Help
Close

Name

Community

  • Learn
  • Develop
  • Connect

Discover IBM

  • ConnectMarketplace
  • Products
  • Services
  • Industries
  • Careers
  • Partners
  • Support
10.190.13.206

Refine your search by using the following advanced search options.

Criteria Usage
Questions with keyword1 or keyword2 keyword1 keyword2
Questions with a mandatory word, e.g. keyword2 keyword1 +keyword2
Questions excluding a word, e.g. keyword2 keyword1 -keyword2
Questions with keyword(s) and a specific tag keyword1 [tag1]
Questions with keyword(s) and either of two or more specific tags keyword1 [tag1] [tag2]
To search for all posts by a user or all posts with a specific tag, start typing and choose from the suggestion list. Do not use a plus or minus sign with a tag, e.g., +[tag1].
  • Ask a question

Formatting Responses using IBM Watson Assistant

3100028R2T gravatar image
Question by graceful_watson  (69) | Nov 12, 2018 at 02:13 PM watson-assistantformattinghtml5

Having read a few different entries on here and Stackoverflow, I am trying to format some of the Watson Assistant outputs with HTML markup to add hyperlinks, emails, bold characters etc... An example is below:-

 Please click on this link to the <a  target="_blank" href="https://myurl.com”>video </a>.\n<br/><br/>. The password is <b>openthevideo</b>.

Here's my json output:-

 {
   "output": {
     "generic": [
       {
         "time": 2000,
         "typing": true,
         "response_type": "pause"
       },
       {
         "values": [
           {
             "text": "Please click on this link to the <a  target=\"_blank\" href=\"https://myurl.com”>video </a>.\\n<br/><br/>. The password is <b>openthevideo</b>\n"
           }
         ],
         "response_type": "text",
         "selection_policy": "sequential"
       }
     ]
   }
 }

Nonetheless, it returns the HTML source code when testing

alt text

Any suggestions on what I'm doing wrong?

Thanks

screenshot-2018-11-12-at-191234.png (86.2 kB)

People who like this

  0
Comment
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster

2 answers

  • Sort: 
270007GD68 gravatar image

Answer by MitchMason (5245) | Nov 12, 2018 at 02:59 PM

The preview link will have HTML support added in the near future. Its really meant for quick and dirty basic testing. As stated above, once on the iOS device whatever application is displaying the responses will have to have HTML support, which is fairly common nowadays so shouldn't be too much trouble.

you'll notice it should work in the tryout panel for testing, preview link will soon follow.

Comment
graceful_watson
@chughts

People who like this

  2   Show 1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
3100028R2T gravatar image graceful_watson (69)   Nov 12, 2018 at 03:42 PM 0
Share

Thanks @MitchMason . Indeed it does work in the tryout panel

110000PNBC gravatar image

Answer by @chughts (11657) | Nov 12, 2018 at 02:34 PM

This is not a Watson Assistant specific question. Clearly Watson Assistant is outputting the markup correctly. The question actually relates to your client side code and how it is injecting the text output onto your test page. That is the code and html that you need to share to allow us to debug it for you.

It looks like you are setting the text of something like a multiline text box. Whereas what you want to be doing is inserting into something like a styled <div> or <span>

Comment

People who like this

  0   Show 1   Share
10 |3000 characters needed characters left characters exceeded
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
3100028R2T gravatar image graceful_watson (69)   Nov 12, 2018 at 02:47 PM 0
Share

Many thanks for the response.

I am using the 'Preview link' option in the new integration functionality of Assistant. The actual end client running the chatbot will be an iOS device though.

Follow this question

147 people are following this question.

Answers

Answers & comments

Related questions

Can dynamic training break normal (Watson assistant) service processing? 1 Answer

Deployed bot marks irrelevant messages (entities mostly) as an intent every time (mostly #Greeting). Causes conversation to jump to "Hello" if the wrong thing is said at the wrong time. 2 Answers

Unable to see response from Cloud Function inside Watson Virtual Assistant 2 Answers

Watson Assistant call transfer - call hangs up 7 Answers

watson speech to text error on node.js 0 Answers

  • Contact
  • Privacy
  • IBM Developer Terms of use
  • Accessibility
  • Report Abuse
  • Cookie Preferences

Powered by AnswerHub

Authentication check. Please ignore.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • API Connect
  • Analytic Hybrid Cloud Core
  • Application Performance Management
  • Appsecdev
  • BPM
  • Blockchain
  • Business Transaction Intelligence
  • CAPI
  • CAPI SNAP
  • CICS
  • Cloud Analytics
  • Cloud Automation
  • Cloud Object Storage
  • Cloud marketplace
  • Collaboration
  • Content Services (ECM)
  • Continuous Testing
  • Courses
  • Customer Experience Analytics
  • DB2 LUW
  • DataPower
  • Decision Optimization
  • DevOps Services
  • Developers IBM MX
  • Digital Commerce
  • Digital Experience
  • Finance
  • Global Entrepreneur Program
  • Hadoop
  • Hybrid Cloud Core
  • IBM Cloud platform
  • IBM Design
  • IBM Forms Experience Builder
  • IBM Maximo Developer
  • IBM StoredIQ
  • IBM StoredIQ-Cartridges
  • IIDR
  • ITOA
  • InformationServer
  • Integration Bus
  • Internet of Things
  • Kenexa
  • Linux on Power
  • LinuxONE
  • MDM
  • Mainframe
  • Messaging
  • Node.js
  • ODM
  • Open
  • PowerAI
  • PowerVC
  • Predictive Analytics
  • Product Insights
  • PureData for Analytics
  • Push
  • QRadar App Development
  • Run Book Automation
  • Search Insights
  • Security Core
  • Storage
  • Storage Core
  • Streamsdev
  • Supply Chain Business Network
  • Supply Chain Insights
  • Swift
  • UBX Capture
  • Universal Behavior Exchange
  • UrbanCode
  • WASdev
  • WSRR
  • Watson
  • Watson Campaign Automation
  • Watson Content Hub
  • Watson Marketing Insights
  • dW Answers Help
  • dW Premium
  • developerWorks Sandbox
  • developerWorks Team
  • Watson Health
  • More
  • Tags
  • Questions
  • Users
  • Badges