Answered

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


Userlevel 3

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.

icon

Best answer by picsoung 27 May 2022, 03:55

View original

2 replies

Userlevel 7
Badge +5

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

Userlevel 7
Badge +5

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