Help

Getting and writing new lines in long text fields through API

Topic Labels: API
Solved
Jump to Solution
921 2
cancel
Showing results for 
Search instead for 
Did you mean: 
einfachiso
5 - Automation Enthusiast
5 - Automation Enthusiast

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:

einfachiso_0-1707928824196.png

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

einfachiso_1-1707929015748.png

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

einfachiso_2-1707929140912.png

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

Any help would be highly appreciated.

 

 

1 Solution

Accepted Solutions
TheTimeSavingCo
18 - Pluto
18 - Pluto

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

Screenshot 2024-02-15 at 11.03.08 AM.png

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

Screenshot 2024-02-15 at 11.03.29 AM.png

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

See Solution in Thread

2 Replies 2
TheTimeSavingCo
18 - Pluto
18 - Pluto

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

Screenshot 2024-02-15 at 11.03.08 AM.png

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

Screenshot 2024-02-15 at 11.03.29 AM.png

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

einfachiso
5 - Automation Enthusiast
5 - Automation Enthusiast

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.