Text Functions

Mike Jones
Mike Jones
  • Updated

Text Functions

Text Functions provide a way to normalize and update your data. Each function is designed to accept one or multiple inputs. 

Camel Case

Capitalizes the first letter of every word in a string. No other characters are changed. 

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes a text/string value.

Example:

The input string, "company name", will be returned as "Company Name"

 

Capitalize

Capitalizes the first letter of the first word in a string. No other characters are changed.

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes a text/string value.

Example:

The input string, "adopt a shelter animal.", will be returned as "Adopt a shelter animal."

 

Concatenate

This function can be used to concatenate the values of two or more fields. You have options to select the fields from the Source entity, the Syncari entity and/or a value generated from the previous node within the pipeline. The output of this function will be the concatenated value of the fields you set in the configuration. 

Configuration:

mceclip0.png

1. Enter a label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain what the function is configured to do.

3. Choose the delimiter that will be inserted in between each value to be concatenated. If you want a space between each value enter a space into the Delimiter. Leave this field empty if you do not need any characters in between the concatenated field values. 

4. The Insert Token option allows you to specify a field token for the delimiter value. 

5. This is a dropdown menu of all available fields. Be sure to connect the Concatenate function to your pipeline in order to see all fields that are available to you. The fields listed on the dropdown will be grouped into these categories:

Fields from the Source Synapse:mceclip1.png

Fields from the previous node in the pipeline and the Syncari Entity: 

mceclip2.png

Extract Text

This function extracts a text value from a given input String/Text, by matching on provided search expression.

By default the function returns the first match. If you need all the matches, turn ON the "

  

Extract Domain

This function extracts the domain from an Email Address or Website URL. The function assumes you are passing a field value that is set to either an email or URL.  

Configuration
mceclip3.png

1. Enter a label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain the criteria configured.

3. You have 3 options to choose from. Select Full Domain, Name or Root Domain.

Using these example values,

Website URL: https://info.example.com
Email Address: contact@email.example.com 

This table provides the extracted values based on the option selected:

Option Website Domain Extracted Email Domain Extracted
Full Domain info.example.com email.example.com
Name example example
Root Domain example.com example.com

 

Indexof

The Indexof function searches for a string within the input value and returns the index of the first occurrence of the specified string. The output of this function will be a number. -1 is returned when the function does not find the search string within the input.

Configuration:

mceclip4.png

1. Enter a label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain the criteria configured.

3. Enter the Search String. This will be searched within the input value. 

4. The Insert Token option can be used to set the Search String to a field value. 

Examples:

- If the Input = null and the Search String = "car", the function will output -1.

- If the Input = "I love Syncari!" and the Search String = "hello", the function will output -1.

- If the Input = "Syncari" and the Search String = "car", the function will output 3. Note the first index is 0. 

 

Length

The length function returns the length of a given String.

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes a text/string value.

Examples:

- If the input is California the function will output a value of 10.

- The Length function can also count the length of values within an array of values. For example, if the input is this array of values [apple, orange, lemon, figs] the output will provide the length of each value as [5,6,5,4]

 

Lower

Modifies the input string by changing the all characters to lower case. This function is useful for normalizing text to lower case letters.

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes a text/string value.

Example:

If you receive an email address with upper case letters, LEAD@COMPANY.COM, the function will return the value, lead@company.com

 

Lpad

The Lpad function pads the given input text with a specified string, to the left of the input text.

Configuration:

mceclip8.png

1. Enter a label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain the criteria configured.

3. "Pad With" is where you will specify what character(s) are inserted to the left of the text value. 

4. The Insert Token option on the Pad With field allows you to select a field value to be referenced in order to dynamically set characters.

5. Pad to Size is where you will specify the maximum length of the new value generated by the Lpad function. For example, if you set the Pad to Size value as 5 and Pad With value as 0, the input value 123 will be updated to 00123. 

6. The Insert Token option on the Pad to Size field allows you to select a field value to be referenced in order to dynamically set a Pad to Size value.

Example:

You may need to normalize a postal code value where leading zeros have been stripped off. If the postal code from the source is 4019 and it really should be 04019, you could use the Lpad function to fill in the leading zeros into the postal code. 

Configure the function with these values:
Pad With: 0
Pad to Size: 5

This configuration will convert 4019 to 04019. Any 5 digit postal code will process through this function and remain unchanged. 

 

Ltrim

The Ltrim function removes any leading whitespace characters from the input text/string value. 

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes a text/string value.

Example:

If the input text is, "   Account Name", the Ltrim function will return "Account Name".

 

Mask

The Mask function hides the original text. This is especially useful for pii fields like ssn or credit card numbers. 

Configuration:

mceclip4.png

1. Enter a label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain the criteria configured.

3. Enter the character to be used to replace each character in the value to be masked. 

4. The Insert Token option allows you to dynamically set the Mask character to a value set on a field.

Example:

Update a SSN from 123-456-789 to ***********

 

Remove Non Printable

This function removes all non printable characters from the given text.

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes a text/string value.

Example:

Input:

\nThis is a sentence.\n

Output:

This is a sentence.

Replace

The replace function can be used to replace characters/words in a string value or remove characters/words from a string. 

Configuration:

mceclip9.png

1. Enter a label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain the criteria configured.

3. Enter a Regular Expression (regex—Java engine) or text to be replaced. For example, enter abc if you want to replace all occurrences of abc in a string. You can use a Regular Expression to perform a search for specific patterns.

4. The Insert Token option allows you to use a dynamic value from a field as your search criteria.

5. Enter the replacement text. You can leave this field empty if you want to replace the string with no value. 

6. The Insert Token option allows you to use a dynamic value from a field as your replacement text.

 

Reverse String

Reverse function reverses the order of the elements in a given String. If null String is provided then it returns the given argument.

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes a text/string value.Returns:

Example:

- Input "Syncari" the output will be "iracnyS"

 

Rpad

The Rpad function pads the given input text with a specified string, to the right of the input text.

Configuration:

mceclip0.png

1. Enter a label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain the criteria configured.

3. "Pad With" is where you will specify what character(s) are inserted to the right of the text value. 

4. The Insert Token option on the Pad With field allows you to select a field value to be referenced in order to dynamically set characters.

5. Pad to Size is where you will specify the maximum length of the new value generated by the Rpad function. For example, if you set the Pad to Size value as 5 and Pad With value as 0, the input value 123 will be updated to 12300. 

6. The Insert Token option on the Pad to Size field allows you to select a field value to be referenced in order to dynamically set a Pad to Size value.

 

Rtrim

The Rtrim function removes any trailing whitespace characters from the input text/string value. 

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes a text/string value.

Example:

If the input text is, "Account Name    ", the Rtrim function will return "Account Name".

 

Split

This function will split a string into a list of elements using a specified delimiter. The function is useful if you want to turn text that is formatted as a list into a list object. 

Configuration:

mceclip1.png

1. Enter a label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain the criteria configured.

3. Enter the character(s) that will be identified as the delimiter within the string of text. 

4. The Insert Token option is useful if you want to set the Delimiter to a dynamic value from a field.  

Example:

Input text:

"Apples Figs Bananas Oranges Persimmons"

With the Delimiter set to a space character the function will output this array/list:

[Apples,Figs,Bananas,Oranges,Persimmons]

 

Strip Tags

The Strip Tags emulates the PHP strip_tags function behavior in Java. This function is useful for removing HTML tags from text. 

Configuration:

mceclip2.png

1. Enter a label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain the criteria configured.

3. Enter the allowed tags that will remain in the text after the function runs. Leaving this field blank will allow the function to remove all tags from the text. 

4. The Insert Token option allows you to dynamically set the Allowed Tags value from a field. 

Example:

If the function receives the following as input text and Allow Tags is set to <a>,

<a>syncari</a><button>rocks</button>

 It will output the following,

<a>syncari</a>rocks

 

Substring

The Substring function returns a portion of the input text using the configured index parameters. The string index starts from 0. For example, the 'S' character in "Syncari" is index 0.

Configuration:

mceclip3.png

1. Enter a label for the node. This will be helpful with identifying the node when viewing your Entity Pipeline.

2. Enter a Description that will explain the criteria configured.

3. Start Index is the position of the first character of the substring. 

4. The Insert Token option allows you to dynamically set the start index value from a field. 

5. End Index is the position of the last character of the substring. 

6. The Insert Token option allows you to dynamically set the end index value from a field. 

Example:

- If the input is "Syncari", a Start Index = 3 and End Index = 4 will have the function return the substring "car"

 

Trim

The Trim function removes all whitespace characters from beginning and end of the input text/string value. 

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes a text/string value.

Example:

If the input text is, "     Account Name     ", the Trim function will return "Account Name".

 

Upper

Modifies the input string by changing the all characters to upper case. 

Configuration:

You can configure the Node Label and Description on this function. There are no other configurable fields. The function should be connected to a node that passes a text/string value into it.

Example:

 A State abbreviation for California set in your records as, ca, the Upper function will output the new value as CA.

 

Share this

Was this article helpful?

0 out of 0 found this helpful