Is there a best practice to validating user input links?

I have a text input field that once entered by the user we will be converting to an external hyperlink using the safeLink function. We are trying to figure how best to validate the contents of the text input field since safeLink doesnt work unless the enters http: or https: (if they do not enter in the http/https the formula redirects to a nonexistent Appian record vs URL).

 

Since the user may also be putting in links to intranet pages(SharePoint, local repositories, etc.), does anyone have an effective method for validating that text input values are valid external URLs outside of simply validating that the contents contain http/https?

 

Thanks in advance!

  Discussion posts and replies are publicly visible

Parents Reply Children
  • If you just want to validate the http/httpsyou can think on something like this "like function"
    with(
    local!link:"http://google.com",
    or(
    like(local!link,"http://*"),
    like(local!link,"https://*")
    )
    )

    But I agree with Jarrod and I prefer always to validate the input with regex because it works really well and has lot of power.

    I hope you don't need the existence of the url and i would suggest to add a field with the type of link (SharePoint, local repositories, etc.) based on it you will validate using different regex. This way you will be able to find the types.

    Best regards
    Jose Perez