Long text line break not showing as a control character through API | Community
Skip to main content
Answered

Long text line break not showing as a control character through API


okrantz

Hi

We have made use of many long text questions and ask our customers to use the shift + enter option to break up the answers. We pull the data through the responses API. All that comes through is a text block with no control character that we could use to break the data up by line and store it as such in the DB.

This seems very strange, as it defeats the purpose of doing a line break in the typeform if it does not come through in the responses. Any help would be appreciated to understand if this is just the case or we are doing something wrong.

Best answer by picsoung

Hi @okrantz 

I just went a head and did a test with this simple typeform

 

The text that I submitted.

And as expected lines are separated by the newline character \n

Here the example payload I get from the Responses API

"answers": [
   {
     "field": {
       "id": "Wmp13MNUmD1P",
       "ref": "01G41KBTEB536MQ73A8EFV85XW",
       "type": "long_text"
     },
     "type": "text",
     "text": "first line\nsecond line\nthird line\n\n\nfifth"
   }
]


Hope this makes sense.

Please share example so we can help you debug this issue :)

View original

2 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14904 replies
  • May 23, 2022

Hi @okrantz Happy Monday! I believe this is expected behavior, but @mathio or @picsoung can confirm this for me!


picsoung
Typeform
Forum|alt.badge.img+5
  • Developer Advocate @ Typeform
  • 384 replies
  • Answer
  • May 27, 2022

Hi @okrantz 

I just went a head and did a test with this simple typeform

 

The text that I submitted.

And as expected lines are separated by the newline character \n

Here the example payload I get from the Responses API

"answers": [
   {
     "field": {
       "id": "Wmp13MNUmD1P",
       "ref": "01G41KBTEB536MQ73A8EFV85XW",
       "type": "long_text"
     },
     "type": "text",
     "text": "first line\nsecond line\nthird line\n\n\nfifth"
   }
]


Hope this makes sense.

Please share example so we can help you debug this issue :)


Reply