Skip to main content
Answered

How to insert a linebreak in a conversation attribute


Hello,

I’m working on a workflow for a chatbot using an API. My issue is simple, this API is returning content from our API that I need to display on Intercom Messenger.

It’s working fine but with an issue: line breaking (\n) are ignored. I tried with <br /> but it wasn’t my best idea → the “<br />” will appear in the conversation. 

I checked the API response in the custom action log, the API is returning JSON as planed, with some \n or \n\n. They just disappear when the content is used in a message in Intercom Messenger. 

Any idea to fix this ?  

Best answer by Jacob Cox

Hi @Alexandre Bougra 

 

I can confirm that this is a known behavior with Custom Actions / REST API at the moment. Submitted line breaks will not be respected when sent via a Custom Action or REST API call. Our team is aware that this isn’t ideal and is looking into it. Thanks for reaching out about that!

View original
Did this topic help you find an answer to your question?

4 replies

Jacob Cox
Intercom Team
Forum|alt.badge.img+5
  • Sr. Technical Support Engineer
  • 441 replies
  • Answer
  • December 10, 2023

Hi @Alexandre Bougra 

 

I can confirm that this is a known behavior with Custom Actions / REST API at the moment. Submitted line breaks will not be respected when sent via a Custom Action or REST API call. Our team is aware that this isn’t ideal and is looking into it. Thanks for reaching out about that!


We are having the same issue. With “<br />” it looks great in the conversation attributes section, but shiows the “<br />” when sent through workflow. Is there any work around? How can we set info with multiple lines through the workflow?


Forum|alt.badge.img
  • New Participant
  • 2 replies
  • February 25, 2024

I get why you're annoyed about line breaks not showing up right in Intercom Messenger when using API stuff. So, here's what you can do: first, try fixing it in your custom action before sending the message by changing "\n" to "<br>" tags. Or, if you can, use Markdown to format your text with line breaks. If your message is super long, you can split it into smaller ones using Intercom's message segmentation feature. Just make sure to test whatever you choose to do so it works right in Intercom Messenger.


Jacob Cox
Intercom Team
Forum|alt.badge.img+5
  • Sr. Technical Support Engineer
  • 441 replies
  • April 6, 2024

Just a heads up that the team has now implemented the ability to create multiline attributes in Custom Actions!


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings