---
schema_version: "1"
id: ae22e5c9f7d23d28279992b47dbdb4d3347e90c27a682b8465bba0207a1b9fcd
title: Supported Library Functions
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/data/264-0-0/c360_a_supported_library_functions.md
canonical_url: https://help.salesforce.com/s/articleView?id=data.c360_a_supported_library_functions.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 0be4dc02bb188e71bdcf718b24e88dd3c5c84c37b210860936c415d44beb9e6a
description: In the Data 360 data library, you can choose functions and operators. You can nest functions.
products:
  - Data 360
release: "264"
---
# Supported Library Functions

In the Data 360 data library, you can choose functions and operators. You can nest functions.

Functions are case-sensitive, and the convention is uppercase letters. For example, enter IF( ), not if( ).

You can reference these functions in the syntax editor.

## Conversion Functions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:29.49852507374631%">
          <col style="width:70.50147492625369%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d98613e53">Function Name</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d98613e56">What It Does</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">ABS(number)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">
              <p>Returns the absolute value of a number. </p>
              <p style="margin-bottom:0;">Example:
                ABS(sourceField['quantity']) with a quantity of -48 returns <code>48.0</code>.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">COMPRESS(value1)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">
              <p>Compresses a string using gzip and returns it in base64. </p>
              <p style="margin-bottom:0;">Example:
                COMPRESS(sourceField['name']), where name is Andrew Lawrence, returns <code> COMPRESSED~H4sIAAAAAAAAAHPMSylKLVfwSSwvSs1LTlUAAOpHEAwQAAAA
                  </code>.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">DECODE_BASE64(value1)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">Decodes a string from base64.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">ENCODE_BASE64(value1)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">Encodes a string to base64.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">FORMATDATE(date, pattern)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">
              <p>Returns the string representation of the given date according to the supplied
                pattern. </p>
              <p style="margin-bottom:0;">Example: FORMATDATE(sourceField['createdDate'],'yyyy-MM-dd') for a date
                created as Oct 16, 2024 returns 2024-10-16.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">MD5(stringToHash)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">
              <p>Returns an MD5 hash of the given string.</p>
              <p>Example: MD5(sourceField['name']),
                where name is Andrew Lawrence, returns <code>b5101112a252d5a1f7e8af8ea893901e</code>.</p>
              <div class="slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium">
                <div class="slds-media slds-media_responsive">
                  <div class="slds-media__figure"><span class="slds-icon_container slds-icon_container_circle "></span></div>
                  <div class="slds-media__body" style="padding-top:.5rem;padding-bottom:.5rem;"><span class="slds-text-title_caps">Restriction</span> The MD5 function isn't available in Government Cloud. Use
                    SHA256 instead.</div>
                </div>
              </div>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">NUMBER(value1)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">Converts a string to a number.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">PARSEDATE(dateString, pattern)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">
              <p>Returns the date object specified by the given dateString using the given
                pattern.</p>
              <p style="margin-bottom:0;">Example: PARSEDATE(sourceField['createdDate'], 'yyyy-MM-dd'), where
                createdDate is 2014-02-25, returns the date object 2014-02-25. </p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">ROUND(number)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">
              <p>Rounds a number to the nearest integer. </p>
              <p style="margin-bottom:0;">Example: ROUND(sourceField['cost']),
                where cost is 45454.9, returns 45455. If cost is 45454.1, it returns
                45454.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">SHA256(stringToHash)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">
              <p>Returns an SHA256 hash of the given string.</p>
              <p style="margin-bottom:0;">Example:
                SHA256(sourceField['name']), where name is Andrew Lawrence, returns <code>cc0b796c0ebea8fb21abca58deed9e7adbaee88f607037c9dc98d344b7809ac5</code>.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">UNCOMPRESS(value1)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">
              <p>Uncompresses a base64 string using gzip.</p>
              <p style="margin-bottom:0;">Example:
                UNCOMPRESS(sourceField['name']), where name is <code>
                    COMPRESSED~H4sIAAAAAAAAAHPMSylKLVfwSSwvSs1LTlUAAOpHEAwQAAAA </code>, returns
                Andrew Lawrence.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e53 ">UUID()</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e56 ">Returns a 36-character UUID number.</td>

          </tr>
        </tbody>
      </table>

## Date Functions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:36.36363636363637%">
          <col style="width:63.63636363636363%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d98613e229">Function Name</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d98613e232">What It Does</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e229 ">DATE(year, month, day)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e232 ">Returns the date representing the given arguments.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e229 ">DATEDIFF(interval, startDate, endDate)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e232 ">Returns the number of time units specified by interval between the startDate
              and endDate. The startDate and endDate arguments must be date objects or date
              strings in standard form. The interval must be one of the following: yyyy (year), q
              (quarter), m (month), d (day), ww (week), h (hour), n (minute), s (second).</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e229 ">DATEADD(interval, number, date)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e232 ">Returns the date after which a certain time or date interval is added. The
              interval must be one of the following: 'yyyy' (year), 'q' (quarter), 'm' (month),
              'd' (day), 'ww' (week), 'h' (hour), 'n' (minute), 's' (second).</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e229 ">DAYSBETWEEN(startDate, endDate)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e232 ">Returns the number of days between the given startDate and endDate. The
              arguments must be date objects or date strings in standard form.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e229 ">DAYS_IN_MONTH(date)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e232 ">
              <p>Returns the number of days in a specified month.</p>
              <p style="margin-bottom:0;">Example:
                DAYS_IN_MONTH(sourceField['createdDate']), where createdDate is Oct 16, 2024,
                returns 31.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e229 ">DAYPRECISION(date)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e232 ">
              <p>Returns the given date with day precision, meaning that the hours, minutes, and
                seconds fields are all set to 0. </p>
              <p style="margin-bottom:0;">Example:
                DAYPRECISION(sourceField['createdDate']), where createdDate is Oct 16, 2024 11:45
                AM, returns 2024-10-16 00:00:00.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e229 ">NETWORKDAYS(startDate, endDate)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e232 ">Returns the number of workdays between two dates, excluding weekends. The
              arguments must be date objects or date strings in standard form.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e229 ">NOW()</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e232 ">Returns the current system date and time.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e229 ">SETHOUR(date, hour)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e232 ">
              <p>Returns the given date set with the given hours. Hour must be a numeric value
                between 0 and 23.</p>
              <p style="margin-bottom:0;">Example: SETHOUR(sourceField['createdDate'], 17), where
                createdDate is Oct 16, 2024, returns Wed Oct 16 17:00:00 GMT 2024.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e229 ">TODAY()</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e232 ">Returns the current system date in UTC.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e229 ">TOSECONDS(duration)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e232 ">Returns the number of seconds represented by the given duration string in the
              format HH:mm:ss/HH:mm:ss.SSS.</td>

          </tr>
        </tbody>
      </table>

## Logical Functions

 
| Function Name | What It Does |
| --- | --- |
| IF(condition,resultIfTrue, resultIfFalse) | Returns the second argument if the first argument is true, and third argument if otherwise |
| AND(condition1, condition2) | Logical AND, checks to see that both conditions are true |
| OR(condition1, condition2) | Logical OR, Checks to see if either one of the conditions is true |
| NOT(condition) | Logical NOT, reverses the logic of its argument, true becomes false and vice versa |

## Text Functions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
        <colgroup>
          <col style="width:40.81632653061224%">
          <col style="width:59.183673469387756%">
        </colgroup>
        <thead class="slds-text-title_caps ">
          <tr class="">
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d98613e433">Function Name</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d98613e436">What It Does</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">CHAR()</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">
              <p>Returns the ASCII character specified by a number. </p>
              <p style="margin-bottom:0;">Example: CHAR(61) returns
                =.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">CONCAT(text1, text2, ...)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">Joins two or more text strings into one string.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">COALESCE([value1, value2, ...])</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">Returns the first value from the list that isn’t empty.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">COUNT_CHAR(text, charToCount)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">
              <p>Returns the count of a specific character in a text.</p>
              <p style="margin-bottom:0;">Example:
                COUNT_CHAR('Tokyo', 'o') returns 2.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">EXTRACT(text, delimiter, position)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">
              <p>Extracts from the given text the substring at the given position, after
                splitting by the given delimiter.</p>
              <p style="margin-bottom:0;">Example: EXTRACT('a_b_c', '_', 1) returns b.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">FIND(findText, withinText)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">
              <p>Returns the starting position of findText in withinText. Returns -1 if
                withinText doesn’t contain findText.</p>
              <p style="margin-bottom:0;">Example: FIND('l', 'Tokyo is a metropolis')
                returns 18.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">FUZZYMATCH(valueToMatch, array, threshold)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">
              <p>Searches for a string in an array of values that match using
                duplicate-detecting algorithms that calculate the similarity of two streams of data.
                Returns the matched string from the array if there’s a match, and returns an empty
                string if there’s no match. </p>
              <p style="margin-bottom:0;">Example: FUZZYMATCH('ABC Company',['ABC Company
                Inc','Apple Inc','IBM Company'],0.8) returns ABC Company Inc.</p>
              <p style="margin-bottom:0;">The threshold
                parameter must be a value from 0 through 1. A threshold of 1 means an exact
                match.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">ISEMPTY(value)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">Indicates whether the value is empty.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">LEFT(text, numOfChars)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">
              <p>Returns the requested number of characters starting from the left.</p>
              <p style="margin-bottom:0;">Example:
                LEFT(sourceField['name'], 3), where name is Andrew Lawrence, returns
                And.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">LEN(text)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">Returns the number of characters in the given text.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">LOWER(text)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">Converts all uppercase letters in a text string to lowercase.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">PROPER()</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">
              <p>Capitalizes the first letter of each word in a text string. </p>
              <p style="margin-bottom:0;">Example:
                PROPER('Oh! An octave is a music series of 8 notes.') returns Oh! An Octave Is A
                Music Series Of 8 Notes.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">REPLACE(sourceStr, pattern, targetStr)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">
              <p>Replaces every match of pattern (a regex expression) in sourceStr to targetStr.
              </p>
              <p>Example: REPLACE('All-The-Best', '-', ' ') returns All The Best.
              </p>
              <p style="margin-bottom:0;">Example: REPLACE('Let It Be',' ','-') returns Let-It-Be.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">RIGHT(text, numOfChars)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">
              <p>Returns the requested number of characters starting from the right.</p>
              <p style="margin-bottom:0;">Example:
                RIGHT(sourceField['name'], 9), where name is Andrew Lawrence, returns
                Lawrence.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">SELECT(sourceStr, pattern)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">
              <p>Selects the first match of the pattern (a regex expression) in sourceStr.
              </p>
              <p style="margin-bottom:0;">Example: SELECT('Hello B wow E Goodbye', 'B(.*?)E') returns B wow
                E.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">SPLIT(text, delimiter)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">
              <p>Splits a text string into an array based on the delimiter character. It returns
                a zero-based, one-dimensional array that includes the parts of the original text
                string. </p>
              <p style="margin-bottom:0;">Example: SPLIT('a,b,c', ',') returns an array with three
                items.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">SUBSTRING(text, beginIndex, endIndex)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">Returns the substring of the text begining at beginIndex (inclusive) and ending
              at endIndex (exclusive).</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">SUBSTITUTE(text, oldText, newText)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">Substitutes newText for oldText in a text string. Use SUBSTITUTE to replace
              specific text in a text string.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">TRIM(text)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">Removes all spaces from the text except for single spaces between
              words.</td>

          </tr>
          <tr class="">
            <td data-label="Function Name" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e433 ">UPPER(text)</td>

            <td data-label="What It Does" class="slds-cell-wrap" style="vertical-align:top;" headers="d98613e436 ">Converts all lowercase letters in a text string to uppercase.</td>

          </tr>
        </tbody>
      </table>