Forum Academy Marketplace Showcase Pricing Features

HELP! How can I double encode text for a URL?

I need to encode text and double encode characters per this article to include in a URL:

The text will change every time and could include characters like . , / ! ? - # etc

Example text to include in a URL:

This is an example for! #nocode

I know there’s a :formatted as URLoption but it doesn’t double encode per the article above. How do I approach it?


The way I’d approach it is a regex to extract the path, then replace the / with %252F

I’m assuming the example you used so the regex is very simple. There may be other ways to do it but this is how I’d do it.


Step 1

Step 2

Step 3

I love Regex (regular expression) so if this isn’t the type of URL you are using ping me and I’ll make a much better regex.


Hey @lindsay_knowcode!

Thank you so much for the response and willingness to help.

I think my use case is a bit different and perhaps I didn’t explain it very well.

Essentially in my app, I have input fields where a user can specify text. One is for the name of a file. Another is for text that will be an overlay in a video or image, etc.
I then take that input field’s value and add it to a URL (API POST request). However, when that input contains special characters such as . , / ! ? - # etc - it breaks the URL/API call because those characters need to be double encoded per the Cloudinary article.

So, I’m not extracting anything from a URL path or parameter.

Lastly, this input field’s value (provided by the user) will be different every time. It may include one special character, three special characters or zero.

Hopefully, that’s a bit clearer of an explanation! Any advice?

Ok a bit clearer now :slight_smile: See here…

In the example I did it two ways to double check Bubble encoding was going to work correctly) - a javascript way using @mishav toolbox plugin (I’d not use this approach for this case - totally unnecessary - but it got my Brain :brain: into Bubble gear this morning) and a pure Bubble way (I’d do it this way).

The simplest way is to set a state and use the inbuilt Bubble URL format twice - eg

If you want to see the working example in the editor

Are you using Cloudinary?


Oh, wow lol so you just need to use the :formatted as URL twice? As in DOUBLE encode haha. Can’t believe I didn’t realize that was the solution!

I’m curious: Why did you use a CS?

Thank you!

Just for fun!

This topic was automatically closed after 70 days. New replies are no longer allowed.