Use these functions to create custom fields in Supermetrics.
Function name | Description |
|---|---|
Absolute | Gets the absolute value from a selected field. For example, abs(10) and abs(-10) would both have 10 as their result. |
Apply date format | Converts date values to the specified format. |
Concatenate | Allows you to combine text strings or fields into one single field. |
Convert data type | Converts data from one type into another, and returns a default result if the change isn't possible. Learn more about our supported data types. |
Count occurrences | Count the number of times a character or piece of text occurs in a text. |
Currency conversion | Convert value to specified currency using historical EOD currency rate. |
Detect logos in images | Detects company and product logos in images. As input for this function, you must add a field that contains an image URL. AI transformation functions are available in all Marketing Intelligence Platform. Limits apply, read more here. |
Divide | Divides a field by a certain value. |
Extract string with regex | Replace field value with a regular expression match. "Pattern" defines a PCRE-compatible regular expression were looking for, and "Index" the regex group index that should be used. Defaults to "1" for the first available match. |
Extract substring | Extract part of a text string based on the number of characters in the string. "Start" defines which character in the string will begin the extracted text, and "Length" defines how many characters will be included in the text. |
Find and replace string with regex | Find and replace strings from field with a regular expression. "Pattern" defines a PCRE-compatible regular expression we're looking for, and "Replace" what the match is replaced with. |
Hash | Hash field with given algorithm. Empty strings are left intact. |
Hash with key | Hash field with given algorithm and secret key. Empty strings are left intact. |
Lower case | Converts any text to lowercase. |
Multiply | Allows you to multiply the value for a field by a given number or the value from another field. |
Replace empty values | Sets a fallback value for any fields that return no data. |
Return bigger value of out two | Selects the greater value from two options. |
Return smaller value out of two | Selects the lesser value from two options. |
Round | Rounds numbers up or down to the next closest integer. |
Round down | Rounds numbers down to the next lowest integer. |
Round up | Rounds numbers up to the next largest integer. |
Split text and pick part | Splits a text string by a delimiter and returns one or more parts. Ideal for extracting a part of a campaign based on campaign taxonomy for example. |
Subtract | Subtracts a given number from a field, or use another field's values to subtract from it. |
Sum | Sums up the values from a field with a given number or values from another field. |
Trim | Strips whitespaces, tabs, and return carriage from the beginning and end of a field's values. |
Upper case | Converts every letter in a text string to a capital letter. |
Upper case first letter | Converts the first letter of a text string into a capital letter. |
AI Custom Fields
AI Transformation functions are available for all Marketing Intelligence Platform. Limits apply; read more here.
Function name | Description |
|---|---|
Custom image analysis | Analyzes images. As input for this function, you must add a field that contains an image URL. |
Detect landmarks in images | Detects landmarks in images. As input for this function, you must add a field that contains an image URL. |
Detect logos in images | Detects company and product logos in images. As input for this function, you must add a field that contains an image URL. |
Image labelling | Labels can identify general objects, locations, activities, animal species, products, and more. As input for this function, you must add a field that contains an image URL. |
Read text from images | Reads text from images using optical character recognition (OCR). As input for this function, you must add a field that contains an image URL. |
Sentiment analysis | Categorizes text values in sentiments from very positive to very negative. Not that AI may produce inaccurate results. |
Transform with AI prompt | Use LLM to enrich or transform your value using a prompt. |
Translation | Translates text values in any language. Note that AI may produce inaccurate results. |