How can I add BOLD or Italic response in Dialogflow console

1,073 views
Skip to first unread message

Priya Arunagiri

unread,
Jun 16, 2022, 10:34:46 AM6/16/22
to Dialogflow Essentials Edition users
I need to give my dialogflow response under intent in Bold and Italic but its rendering as normal response. Anyone know how to do it?

Eduardo Ortiz Caraveo

unread,
Jun 17, 2022, 3:50:56 PM6/17/22
to Dialogflow Essentials Edition users

You can add an bold / italic format with the next code I'm sharing.


"richContent": [ 

"type": "description", 

"title": "Description title",

"text": [ 

"This is text line 1.", (Normal)

*This is text line 2.*, (Bold)

"_This is text line 3._" (Italic)

Devashish Mamgain

unread,
Jun 18, 2022, 6:55:35 AM6/18/22
to Eduardo Ortiz Caraveo, Dialogflow Essentials Edition users
Hi Priya,

Last time when we checked, Dialogflow wasn't rendering the Bold Or Italic Text in the "Dialogflow Messenger".
However, you will be able to achieve this using Dialogflow +  Kommunicate integration, and that will across all web, mobile apps, etc
For this, please use the below code in Custom Payload under that particular Intent.

{
  "messageType": "html",
  "message": "I need to give my dialogflow response under intent in <b> Bold </b> and <i> Italic </i> but its rendering as normal response. ",
  "platform": "kommunicate"
}
image.png
image.png


--
© 2021 Google Inc. 1600 Amphitheatre Parkway, Mountain View, CA 94043
 
Email preferences: You received this email because you signed up for the Dialogflow Essentials (f.k.a. Enterprise) Edition Discussion Google Group (dialogflow-essent...@googlegroups.com; former email: dialogflow-enterp...@googlegroups.com) to participate in discussions with other members of the Dialogflow community and the Dialogflow Team.
---
You received this message because you are subscribed to the Google Groups "Dialogflow Essentials Edition users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dialogflow-essentials-e...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dialogflow-essentials-edition-users/3b224d3a-9fdd-42d9-a32f-8de4eb382abbn%40googlegroups.com.

Mizar Contasti

unread,
Jun 18, 2022, 1:34:48 PM6/18/22
to Dialogflow Essentials Edition users
Bro can you stop publishing your platform, this is dialogflow group, not Kom...

Mizar Contasti

unread,
Jun 18, 2022, 1:36:05 PM6/18/22
to Dialogflow Essentials Edition users

Hi, that depends of the platform you are using. On Web integration, you must use a span and add styles or use italic specific html tag.

If you are not using any integration you wont be able to get bold or italic.

Devashish Mamgain

unread,
Jun 18, 2022, 1:40:24 PM6/18/22
to Mizar Contasti, Dialogflow Essentials Edition users
Hi Mizar,

If it violates the group policies, i am happy to remove my answer.

As I understand the question is about Dialogflow, and here my answer is with respect to Dialogflow integration with our platform, and not something that doesn't involve Dialogflow.

I have received many replies from this same group, appreciating the solutions.
Sorry if my answer bothers you.
Again, if the answer violates the group policy, Admins are free to remove my answer.

Devashish Mamgain

unread,
Jun 18, 2022, 2:08:50 PM6/18/22
to Mizar Contasti, Dialogflow Essentials Edition users
With respect to Priya's question. 

There are some serious problems with directly using or allowing HTML to work in a chat message.

1. Security issue - HTML injection: 
If you are allowing HTML code to be applied in the message bubble of the frontend widget, then the attacker will be able to use HTML injection to modify the page or access information 

Whichever frontend panel you are using that needs to have the security in-built to safe guard from HTML injection. If you are developing your own front end to connect with Dialogflow then i would suggest, create your own payload format that specifies this is HTML type message, and then in the frontend code, you can apply safety method to parse the HTML code and display it.
{
  "messageType": "html",
  "message": "I need to give my dialogflow response under intent in <b> Bold </b> and <i> Italic </i> but its rendering as normal response. ",
  "platform": "kommunicate"
}

2. Once you use the same Dialogflow bot in Mobile apps, Facebook, or other channels. The hack used for adding bold using styles will break things on other platforms.
Reply all
Reply to author
Forward
0 new messages