Preventing Newline in Text entry component to avoid JSON errors

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 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!

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

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.

2 Likes

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?

@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

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:

2 Likes

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

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

1 Like

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