I’m using Glide API to archive rows. I’d like to escape out all the offending characters with one JavaScript column instead of multiple Replace all columns, and I’m not very experienced with JavaScript yet.
For example, this little snippet that I got from a free AI tool
That’s weird. I can’t reproduce your issue. I don’t know if there are other hidden characters that I’m missing, or my device is just handling it differently.
I’ll try playing around some more, but since I can’t reproduce, I don’t know if I’ll have an answer for you. If anything, you could try a different browser or computer to see if a different javascript engine makes a difference.
I don’t typically worry much about the warnings. They are just warnings, and many times due to one row that may have an empty or unexpected value. If they get in the way, then I’ll usually put it a Try/Catch to catch any errors and bow out gracefully. But I think Glide already does that and that’s why it only shows as a warning.
I would take a step back here and look at the bigger picture.
When you talk about “offending” characters, I’m guessing that you are referring to characters that result in broken JSON when the JSON is constructed using a template?
If that’s the case, what you should be doing is using the JSON Object and/or JSON Template columns to construct your JSON. Using these columns will ensure that you always get valid JSON, without having to resort to any JavaScript gymnastics.