This page outlines all the utility functions that are available in NetScript.
to_string(input)
This function returns the input cast to string. Input can be any value.
Function: to_string(input)
Data Type: string
Example:
to_string(5)
Result:
"5"
to_int(input)
This function returns the input cast to integer. Input can be any value.
Function: to_int(input)
Data Type: string
Example:
to_int(10.1)
to_int('10')
Result:
"10"
"10"
to_boolean(input)
This function returns the input cast to boolean. Input can be any value.
Function: to_boolean(input)
Data Type: boolean
Example:
to_boolean('true')
"true"
to_float(input)
This function returns the input cast to float. Input can be any value.
Function: to_float(input)
Data Type: float
Example:
to_float('10.5')
10.5
to_timestamp(input)
This function returns the input cast to timestamp. Input can be any value.
Function: to_timestamp(input)
Data Type: timestamp
Example:
to_timestamp(dateColumn)
"2024-01-01 08:00:00"
coalesce
This function returns the first non-null value in the list of 2 or more arguments.
Function: coalesce
Example:
coalesce(null, 1)
1
Please sign in to leave a comment.