Skip to content

IsValidUri Operator

Martin Danielsson edited this page Jul 23, 2015 · 2 revisions

The IsValidUri validates URIs and checks whether they are valid https:// or http:// URIs. This operator is useful for ensuring data quality e.g. for customer web site data.

What Type
Syntax IsValidUri(uri)
uri string
Return type bool

The operator tries to create a .NET System.Uri instance out of the provided uri string; if it succeeds, and the resulting scheme type is UriSchemeHttp or UriSchemeHttps (i.e., the URI starts with http:// or https://), the operator will return true. In all other cases, it will return false.

Caution: As usual, this is not the way Salesforce checks for URI validity. To achieve the same kind of validation as Salesforce does, use a custom regular expression and the RegExMatch Operator. An example gives the actual Salesforce URI validation there.

Clone this wiki locally