@servicenow/sdk - v4.4.1
    Preparing search index...
    interface UtilitiesFns {
        getFirstItem: GetFirstItem;
        getItemFromNameValues: GetItemFromNameValues;
        getLastItem: GetLastItem;
        getNthItem: GetNthItem;
        isBlank: IsBlank;
        isFalse: IsFalse;
        isNotBlank: IsNotBlank;
        isNull: IsNull;
        isTrue: IsTrue;
        join: Join;
        keyValueMap: KeyValueMap;
        sort: Sort;
        unique: Unique;
    }
    Index

    Properties

    getFirstItem: GetFirstItem

    Returns the first item from the input Array as a Complex Object.

    Array of any values.

    Complex Object - First item found in the input Array

    getFirstItem([1,2,3]) // → 1
    

    If input data type is not Array, the data is not transformed at runtime.

    getItemFromNameValues: GetItemFromNameValues

    Returns the value for a given key from a map of name/value pairs.

    Array of {name,value} objects.

    Name of the key used to look up its corresponding value

    The default value returned if the provided Key is not found in the map of Name/Values

    String - Value associated with matching key

    getItemFromNameValues([{name:'a',value:'x'}],'a','d') // → 'x'
    

    If input data type is not Name/Values or Name-Value Pairs, the data is not transformed at runtime.

    getLastItem: GetLastItem

    Returns the last item from the input Array as a Complex Object.

    Array of any values.

    Complex Object - Last item found in the input Array

    getLastItem([1,2,3]) // → 3
    

    If input data type is not an array, the data is not transformed at runtime.

    getNthItem: GetNthItem

    Returns a Complex Object from the input Array.

    Array of any values.

    Index of the target object in the input Array. Array index starts at 0.

    Complex Object - Target object found in the input Array

    getNthItem(['a','b','c'],1) // → 'b'
    

    If input data type is not an array, the data is not transformed at runtime.

    isBlank: IsBlank

    A utility function that checks whether the input value is blank. The function supports Integers, Double, Boolean, Complex Objects and String.

    Pills or values of above mentioned Types

    Boolean - True if string is empty or whitespace

    isBlank('') // → true
    

    If input data type is not String, the data is not transformed at runtime.

    isFalse: IsFalse

    A utility function that checks whether the input value is false. The function supports Integers, Double, Boolean, Complex Objects, and String.

    Pills or values of above mentioned Types

    Boolean - True if input strictly equals false

    isFalse(false) // → true
    

    For Integer and Double values that are 0, the transform returns true. For strings that are empty or "0", the transform returns true. For Complex objects and arrays that have a value, the transform returns false. For false boolean values, the transform returns true.

    isNotBlank: IsNotBlank

    A utility function that checks whether the input value is NOT blank. The function supports Integers, Double, Boolean, Complex Objects and String.

    Pills or values of above mentioned Types

    Boolean - True if string has non-whitespace chars

    isNotBlank('abc') // → true
    

    For Integer and Double values which are not 0, the transform returns true. For strings that are not empty or not "0", the transform returns true. For Complex objects and arrays that have a value, the transform returns true. For true boolean values, the transform returns true.

    isNull: IsNull

    A utility function that checks whether the input value is null.

    Pills or values of above mentioned Types

    Boolean - True if input strictly equals null

    isNull(null) // → true
    

    If the input value or complex object is null, the transform returns true.

    isTrue: IsTrue

    A utility function that checks whether the input value is logically true. The function supports Integers, Double, Boolean, Complex Objects, and String.

    Pills or values of above mentioned Types

    Boolean - True if input strictly equals true

    isTrue(13) // → true
    

    For Integer and Double values that are not 0, the transform returns true. For strings that are not empty or not "0", the transform returns true. For Complex objects and arrays that have a value, the transform returns true. For true boolean values, the transform returns true.

    join: Join

    Concatenates the given input with the delimiter and returns the concatenated string.

    Array of primitive values.

    Delimiter to be attached with each given input element.

    String - String joined with delimiter.

    join(['a','b','c'],'<') // → 'a<b<c'
    

    If input data type is not an array.string, array.integer, array.boolean and array.datetime, the data is not transformed at runtime.

    array.object type input is not supported.

    keyValueMap: KeyValueMap

    Returns a value associated with a key from a map of Name/Values.

    String

    The default value returned if the provided Key is not found in the map of Name/Values

    Map of key-value pairs in which to locate the Key input

    String - Value associated with matching key

    keyValueMap("3","Medium",[{name:'1',value:'High'},{name:'2',value:'Medium'},{name:'3',value:'Low'}]) // → 'Low'
    

    If input data type is not String, the data is not transformed at runtime.

    sort: Sort

    Returns sorted array, sorted in ascending or descending order.

    Array.

    Sort order: ascending or descending.

    Array - Sorted array

    sort([3,1,2],'ascending') // → [1,2,3]
    

    If input data type is not an array.string, array.integer, array.boolean and array.datetime, the data is not transformed at runtime.

    array.object type input is not supported.

    unique: Unique

    Removes duplicate elements from the input array.

    Array.

    Array - Array with unique elements

    unique([7,2,3,2]) // → [7,2,3]
    

    If input data type is not an array.string, array.integer, array.boolean and array.datetime, the data is not transformed at runtime.

    array.object type input is not supported.