Skip to main content
Solved

Regex formula needed for URL http:// & https:// check and add if not there

  • June 30, 2021
  • 2 replies
  • 31 views

Forum|alt.badge.img

I am sending URL’s from Webflow which does not have URL validation easily integrated. I want to check and add the https:// to the beginning of the URL if it is not present when the field is created or updated.

I have been looking through to forums but can’t seem to find an exact match. Would love some help with this please.

Best answer by kuovonne

Welcome to the Airtable community!

Here is one formula.

IF(
    FIND("https://", {url}),
    {url},
    "https://" & {url}
)

Here is a slightly fancier version:

IF(
    OR(
        FIND("https://", {url}) = 1,
        FIND("http://", {url}) = 1
    ),
    {url},
IF(
    {url},
    "https://" & {url}
))

2 replies

kuovonne
Forum|alt.badge.img+29
  • Brainy
  • Answer
  • June 30, 2021

Welcome to the Airtable community!

Here is one formula.

IF(
    FIND("https://", {url}),
    {url},
    "https://" & {url}
)

Here is a slightly fancier version:

IF(
    OR(
        FIND("https://", {url}) = 1,
        FIND("http://", {url}) = 1
    ),
    {url},
IF(
    {url},
    "https://" & {url}
))

Forum|alt.badge.img

Welcome to the Airtable community!

Here is one formula.

IF(
    FIND("https://", {url}),
    {url},
    "https://" & {url}
)

Here is a slightly fancier version:

IF(
    OR(
        FIND("https://", {url}) = 1,
        FIND("http://", {url}) = 1
    ),
    {url},
IF(
    {url},
    "https://" & {url}
))

Hi @kuovonne - Amazing! This works perfectly. Thank you for your very prompt reply!