eADM

[SUBSTRING] - Extracting Parts of a String

The [SUBSTRING] This function allows you to extract a portion of a text string from an attribute. This is useful for cleaning up data, for example, by removing a department number that has been included as a prefix in a department's name.



Syntax

The syntax is:

[SUBSTRING;StartIndex;NumberOfCharacters;Attribute]

  • Home: The 0-based index from which to start the extraction. For example, an index of 3 will start the extraction at the fourth character of the string.

  • NumberOfCharacters: The maximum number of characters to return.

  • Attribute: The attribute containing the string you want to extract from (e.g., [Department]).



Use Case - Removing a Prefix from a Department Name

In some systems, department names are prefixed with numbers, such as "37 Kullungen Daycare Center." This can make lists and directories, such as those on a public website, look disorganized.

Use the [SUBSTRING] function in an export template to remove the prefix from the department name before it is displayed or sent to another system.


  • Input [Department]: 37 Kullungen Daycare Center

  • Expression:

    [SUBSTRING;3;99;[Department]]
    
  • How It Works: The expression begins extracting from the index 3 (the fourth character), which skips the first three characters (3, 7, and the space). It then returns the next 99 characters, which is a number large enough to capture the rest of the string.

  • Output: Kullungen Daycare Center