# How to Automatically Add "https://" Prefix to URLs When Missing?

**URL:** <https://community.glideapps.com/t/how-to-automatically-add-https-prefix-to-urls-when-missing/76207>\
**Category:** Ask for Help\
**Created:** [September 7, 2024, 11:11am UTC](https://community.glideapps.com/t/how-to-automatically-add-https-prefix-to-urls-when-missing/76207 "2024-09-07T11:11:53Z")\
**Posts on this page:** 5\
**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 7, 2024, 11:11am UTC](https://community.glideapps.com/t/how-to-automatically-add-https-prefix-to-urls-when-missing/76207/1 "2024-09-07T11:11:53Z")

</div>

Hi Gliders,

I’m building an app where users need to input a URL that describes an offer. The URL is then sent to a [Make.com](http://Make.com) scenario, where a scraper pulls the page content. The issue is that the scraper requires the URL to be correctly formatted with “https://”, and if users input an incorrectly formatted URL (e.g., just “[www.example.com](http://www.example.com)”), the scenario breaks.

I’m looking for a way to **automatically add the “https://” prefix** to URLs when it’s missing, so even if users don’t format the URL correctly, the app will adjust it before sending it to [Make.com](http://Make.com).

Can you suggest the most effective ways to do this in Glide?  
Thank you very much!

---

<div class="post-metadata">

**Author:** ![Dilip\_Adiga](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/dilip_adiga/32/60330_2.png) [@Dilip\_Adiga](https://community.glideapps.com/u/Dilip_Adiga)\
**Post date:** [September 7, 2024, 11:52am UTC](https://community.glideapps.com/t/how-to-automatically-add-https-prefix-to-urls-when-missing/76207/2 "2024-09-07T11:52:16Z")

</div>

HI @CarloA ,

Just from a basic understanding

Wouldn’t a if-else-if column and Template column to help you in this

Have a template column where input is [https://URL](https://URL)

replace URL with the URL column

assuming you have a url column with name URL

you can pass it through a if-else-if column where you say

if URL includes https:// then → URL

if URL is empty then leave it blank

else ----\> Template columns

If else if column looks like this

 ![Screenshot 2024-09-07 at 5.19.40 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/0/e0e8cddeb10788fe7d65ede7756998bc2e9d6aae.png)

Template column will look like this

 ![Screenshot 2024-09-07 at 5.23.02 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/e/7/e74bec758cbb9086c6ac07909c28f05d69426f7b.png)

It might not be accurate but will get you results.

Regards,  
Dilip

---

<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 7, 2024, 12:00pm UTC](https://community.glideapps.com/t/how-to-automatically-add-https-prefix-to-urls-when-missing/76207/3 "2024-09-07T12:00:36Z")

</div>

You could use a JavaScript column with a regular expression:

```auto
return p1.replace(/^(?!https?:\/\/)(.*)/, 'https://$1');

```

 ![CleanShot 2024-09-07 at 19.58.06@2x](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/b/a/bac0e6f3a1c1acb1a02e1d8f9d33ff64ac66b6d6.png)

---

<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 8, 2024, 12:06am UTC](https://community.glideapps.com/t/how-to-automatically-add-https-prefix-to-urls-when-missing/76207/4 "2024-09-08T00:06:10Z")

</div>

The regex God with the clutch strike!

---

<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 15, 2024, 12:06am UTC](https://community.glideapps.com/t/how-to-automatically-add-https-prefix-to-urls-when-missing/76207/5 "2024-09-15T00:06:22Z")

</div>

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