Skip to main content
Solved

Getting and writing new lines in long text fields through API

  • February 14, 2024
  • 2 replies
  • 54 views

Forum|alt.badge.img+4

When trying to read or write data to and from a long text field via the API, I am loosing the newlines.

This is an example of what I have in the field:

When reading the content through the API, I am getting this:

Also, when writing \n to the field via the API it get's stored literally, i.e., is not translated into linebreaks:

I cannot find any hint how to encode newlines in the API docs or the forum.

Any help would be highly appreciated.

 

 

Best answer by TheTimeSavingCo

For what it's worth, I just tested this with Postman and was able to retrieve long text fields with the line break fine

I was also able to create new records with line breaks fine:

Weird!  Could you try out Postman to see whether your problem still persists?

2 replies

TheTimeSavingCo
Forum|alt.badge.img+31

For what it's worth, I just tested this with Postman and was able to retrieve long text fields with the line break fine

I was also able to create new records with line breaks fine:

Weird!  Could you try out Postman to see whether your problem still persists?


Forum|alt.badge.img+4
  • Author
  • New Participant
  • February 15, 2024

Thanks, Adam. Just tried, actually works as well using Postman. 

Super weird. This is n8n I am using. Seems to be doing some undocumented escaping.