I was wondering if any of you has an idea how to encode text or alternatively use something like the substitute function but within the glide editor?
I have a need where I need to use a string of text within a url but I can’t use the glide construct url column as it doesn’t fit the structure of the url and I would very much like to avoid writing to the sheet for this as it creates a delay in the flow.
I’m trying to create an image with text overlay in cloudinary (which works using sheets function).
In order to do this I need to encode the text as well as replace some characters such as comma which breaks the cloudinary link (as comma used for the setting of the cloudinary transformation)
Actually, just had a thought - you might be able to do it with a URL column and a template column. Leverage the URL column to do the encoding, and then run the URL column through a template to strip out the bits you don’t need?
The url column needs all the or most parameters fills in order to work so didn’t work but I’ll try again to see if there might be a different way to use it
PS. Just to be clear, I tested using a complex URL with multiple text and image overlays that won’t work without being URL encoded - and it worked perfectly using the above.
The one I tested with earlier used multiple image overlays and several lines of text, but I can’t share that one - you’ll just have to take my word that it worked
I think you’re right. Including commas in the text breaks it - even with English text.
I just did some more testing and it appears that the URL column only encodes the parameters - not the path part of the URL construct. I think the fact that it was working for me last night was probably just a fluke. So maybe it’s back to my earlier idea…
The idea I had was to include your entire Cloudinary URL as the parameter part of the URL column (with dummy values for the protocol/host/path), and then use a template column to strip those (and the parameter name) out, leaving just the encoded URL. But I’m not really sure if that will work - I’ll try and find some time to do some testing with it today.
This is what I tried doing but when putting something in the parameters it adds a question mark or equal sign to the link which is not working with cloudinary link
I was able to get it working by using the second method (replacing commas with %E2%80%9A), and then using the result as a replacement in a normal template column (no need for the URL column).
Give that a try and see if it works for you.
Update: Here is a template that double-escapes the standard set of “reserved” characters that are used in a Cloudinary URL…
Using that template, you can take a string of text that looks like this: the, quick: brown/ fox_
And turn it into this: the%252C quick%253A%250A brown%252F%250A fox_%250A
And then that works in a Cloudinary URL