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
  • We have used some validations to define whether the URL is valid or not.
    1. It should always start with http:// or https:// (in some cases you might also consider ftp://, but not sure if safelink URL functions works with this, never tested)
    2. As per standard, URL cannot contain more than 2083 characters
    3. It should have something after 'http://' else the safelink URL will fail.
    4. I also suggest that you consider that URL should not have any special characters like @#$!`^&*\<>?'{};,+=~"" else the safelink URL will fail.

    There might be some more validations that other practitioners have used. Lets see if they come up with some more.
Reply
  • We have used some validations to define whether the URL is valid or not.
    1. It should always start with http:// or https:// (in some cases you might also consider ftp://, but not sure if safelink URL functions works with this, never tested)
    2. As per standard, URL cannot contain more than 2083 characters
    3. It should have something after 'http://' else the safelink URL will fail.
    4. I also suggest that you consider that URL should not have any special characters like @#$!`^&*\<>?'{};,+=~"" else the safelink URL will fail.

    There might be some more validations that other practitioners have used. Lets see if they come up with some more.
Children
No Data