Glide API - Add Row, enter space in text column not passing

Hiya, I am using Glide API to add rows to another table. All is working completely fine UNLESS one of my columns (currently set as rich text) contains an enter space. The source column is rich text and the destination column is rich text. The rest of the columns work fine.

For example if the text passes through the API fine if it is

“Well done! The team is proud of you”

But if the text has an enter space like this then the API action does not work and comes up with a bad request error

"Well done!

The team is proud of you"

Is there a way to include an enter space with a successful API run? Seems like a simple blocker to me… considering users are entering this text I can’t exactly remove enter spaces from their text.

Line breaks are invalid characters in JSON, so they need to be escaped. How are you constructing the JSON? If you use the Glide JSON columns they will take care of this for you.

2 Likes

Thanks Darren, I am using a template column atm to pass the json variables. I’ve just been looking at the 3 json column options - there is limited documentation on how to actually apply this to my simple problem :slight_smile:

So I can just use the json template column instead of a regular template column? That would be fab if yes, removes any workarounds!

Side question - how does the json treat emojis if they’re placed in a rich text column and destination is also rich text? What goes in comes out the same?

It depends on your JSON structure. If you just have a flat list of key/value pairs, then a JSON Object column will do the job. JSON Template is for creating more complex JSON structures, where you have nested objects/collections.

Emojis are just text, so they should be fine as long as the JSON is properly constructed.

2 Likes

This is so good - would love if the tutorials had a few more examples for using json as it opens up a ‘whole new world’ which I’m very excited about!

Thank you for pointing me in the right direction Darren!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.