You are here: Functions > SMARTSEARCH()

SMARTSEARCH()

You can use the SMARTSEARCH() function to test for the presence of a string of characters within specified columns in the active View or within the overall View. The SMARTSEARCH() function returns a true value if the string is found and a false value otherwise. Columns to be searched in the active View can be data columns, computed columns or related columns.

Note: SMARTSEARCH() is not intended for use in procedures as there will likely be no active View. As a result, SMARTSEARCH() is not included in the functions list in the Expression Builder. Use FIND() in procedures.

Similar to the FIND() function. For more information see FIND().

The SMARTSEARCH() function is case-insensitive (finds matches in upper, lower and mixed cases) and searches for ASCII characters based on their displayed value in the active View.

The SMARTSEARCH() function also allows you to search for multiple concurrent strings (separated by blanks) in specific columns in the active View or within the overall View.

Function Format

SMARTSEARCH(string <,column1,column2,..>)

the optional columns specify the columns in the active View that are to be searched for the specified string.

Finding a Single String in the View

To search for a string "plumber" in the active View:

SMARTSEARCH("plumber")

A row is returned if "plumber" is found within any column in the active View.

Finding Multiple Strings in the View

To search for both the string "plumber" and "electrician" in the active View:

SMARTSEARCH("plumber electrician")

The strings are separated by a blank space and are surrounded by quotes. A row is returned if both "plumber" and "electrician" are found within any column in the active View.

Finding a Single String in a Column or Columns

To search for the string "plumber" in the active View column JOB:

SMARTSEARCH("plumber",JOB)

A row is returned if "plumber" is found within the JOB column in the active View.

Finding Multiple Strings in a Column or Columns

To search for both the string "plumber" and "electrician" in the active View columns JOB or TITLE:

SMARTSEARCH("plumber electrician",JOB,TITLE)

The strings are separated by a blank space and are surrounded by quotes. A row is returned if BOTH "plumber" or "electrician" are found within EITHER the JOB or TITLE columns in the active View.

Finding a Literal String in a Column or Columns

To search for a literal string containing blank spaces, surround the literal with double quotes and then surround the double quotes with single quotes. For example, to locate the literal string "pipe fitter" in the active View column JOB:

SMARTSEARCH('"pipe fitter"',JOB)

A row is returned if "pipe fitter" is found within the JOB column in the active View. This differs from the example above of finding multiple strings in a column as the blank is not regarded as a string separator but as part of the overall literal string.