# Preventing Newline in Text entry component to avoid JSON errors

**URL:** <https://community.glideapps.com/t/preventing-newline-in-text-entry-component-to-avoid-json-errors/76171>\
**Category:** Ask for Help\
**Created:** [September 5, 2024, 6:30pm UTC](https://community.glideapps.com/t/preventing-newline-in-text-entry-component-to-avoid-json-errors/76171 "2024-09-05T18:30:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![CarloA](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/carloa/32/74297_2.png) [@CarloA](https://community.glideapps.com/u/CarloA)\
**Post date:** [September 5, 2024, 6:30pm UTC](https://community.glideapps.com/t/preventing-newline-in-text-entry-component-to-avoid-json-errors/76171/1 "2024-09-05T18:30:10Z")

</div>

Hello Glide community,

I’m developing an app where users input a list of keywords into a text entry component, which triggers a scenario on [Make.com](http://Make.com) for keyword research via AI. The results are then sent back to the app as a report.

The issue I’m facing is that if users format the text incorrectly—specifically, if they add newlines (by pressing Enter) instead of keeping the list comma-separated—it breaks the scenario due to the invalid JSON format caused by the newlines. This is a critical issue for the app’s functionality.

I’m looking for **solutions to prevent users from submitting text with newlines in the text entry component**.  
Is there a way to block or filter newline characters in Glide before triggering the action?  
Any guidance would be greatly appreciated!

Thank you!

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [September 5, 2024, 6:38pm UTC](https://community.glideapps.com/t/preventing-newline-in-text-entry-component-to-avoid-json-errors/76171/2 "2024-09-05T18:38:35Z")

</div>

You could use a template column to replace newline characters with a blank or nothing.

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 5, 2024, 6:44pm UTC](https://community.glideapps.com/t/preventing-newline-in-text-entry-component-to-avoid-json-errors/76171/3 "2024-09-05T18:44:53Z")

</div>

How are you generating the JSON?  
If you use either the JSON Object or JSON Template column, then you don’t have worry about it. You will always get valid JSON regardless of the input.

---

<div class="post-metadata">

**Author:** ![CarloA](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/carloa/32/74297_2.png) [@CarloA](https://community.glideapps.com/u/CarloA)\
**Post date:** [September 6, 2024, 8:43am UTC](https://community.glideapps.com/t/preventing-newline-in-text-entry-component-to-avoid-json-errors/76171/4 "2024-09-06T08:43:10Z")

</div>

Thank you for your response @Darren_Murphy !  
The issue doesn’t occur when data is sent from Glide to Make, but rather when the data is returned from Make to Glide via an HTTP call.

Specifically, I need the HTTP call to add a new row to the Glide database, and one of the fields in that row contains the seed keywords. However, if the text contains newlines, the HTTP call results in a “bad request” error.

Am I wrong?

---

<div class="post-metadata">

**Author:** ![CarloA](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/carloa/32/74297_2.png) [@CarloA](https://community.glideapps.com/u/CarloA)\
**Post date:** [September 6, 2024, 8:44am UTC](https://community.glideapps.com/t/preventing-newline-in-text-entry-component-to-avoid-json-errors/76171/5 "2024-09-06T08:44:30Z")

</div>

@Jeff_Hager Thank you. Maybe this could be a good workaround.

I’ve just tried and it seems that I can’t use newline as a replacement… If I press “enter” in the left field nothing happens. Am I missing something?  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/8/2/82f6f411fb1f6fc138b41df0093cdfee887b15b0.png)

---

<div class="post-metadata">

**Author:** ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)\
**Post date:** [September 6, 2024, 9:09am UTC](https://community.glideapps.com/t/preventing-newline-in-text-entry-component-to-avoid-json-errors/76171/6 "2024-09-06T09:09:46Z")

</div>

> [@CarloA](#):
>
> but rather when the data is returned from Make to Glide via an HTTP call.

How are you preparing the JSON Payload in Make?  
Again, if you use the Create JSON module, you should not have to worry about this.  
See below:

> [@Use the Create JSON Module when using Make+Glide API](https://community.glideapps.com/t/use-the-create-json-module-when-using-make-glide-api/58439):
>
> Hey all! If you’re a regular user of [Make.com](https://www.make.com/en/register?pc=robert) and you’re using it to write to Glide using Glide API, be sure to use the Create JSON module to prevent your Make scenarios from failing. Here’s how: [[Use the Create JSON Module When Calling Glide API Via Make] ](https://www.youtube.com/watch?v=9AMmWDWkAJY)

---

<div class="post-metadata">

**Author:** ![CarloA](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/carloa/32/74297_2.png) [@CarloA](https://community.glideapps.com/u/CarloA)\
**Post date:** [September 6, 2024, 1:13pm UTC](https://community.glideapps.com/t/preventing-newline-in-text-entry-component-to-avoid-json-errors/76171/7 "2024-09-06T13:13:22Z")

</div>

This is exactly what I was looking for! Thank you very much!

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [September 7, 2024, 1:15am UTC](https://community.glideapps.com/t/preventing-newline-in-text-entry-component-to-avoid-json-errors/76171/8 "2024-09-07T01:15:07Z")

</div>

> [@Darren\_Murphy](#):
>
> Again, if you use the Create JSON module, you should not have to worry about this.

If Darren has a cent for every time he had to say this to me back in the days 😆

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/system/32/53398_2.png) [@system](https://community.glideapps.com/u/system)\
**Post date:** [September 14, 2024, 1:15am UTC](https://community.glideapps.com/t/preventing-newline-in-text-entry-component-to-avoid-json-errors/76171/9 "2024-09-14T01:15:49Z")

</div>

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