Functions
Overview
Variables and functions can be used in free-text fields within tasks and workflows. When a variable or function is specified in a free-text field, the Controller inserts its value into the field when the task or workflow is run.
Also, triggers can pass variables and functions into the tasks and workflows they launch.
Universal Controller supports a number of functions that can be specified in free-text fields. They are resolved when a task instance runs or when a Set Variable action containing a function is executed.
Functions are entered using the following formats:
${_function} ${_function(arg1, ..., argN)}
Formatting Rules
- Functions must be written either:
- In all lower-case characters.
- Exactly as shown in the tables on this page.
- Functions have zero, one, or multiple parameters.
- Each function parameter is one of three specific types:
- String
- Integer
- Boolean
- String parameters must be enclosed in single or double quotation marks.
- Integer and Boolean parameters can be enclosed in single or double quotation marks.
- Optional parameters are identified on this page by being enclosed in [square brackets]. When copying a function from the documentation, be sure to remove the square brackets; otherwise, the function will not resolve.
- If a function has more than one optional parameter, any optional parameters preceding a specified optional parameter must be included in the function's parameter list. For example:
- For function
${_responseJsonPath('pathExpression'[,'defaultValue','delimiter',prettyPrint])}
, usage${_responseJsonPath('.outputData','','',true)}
would be valid, whereas${_responseJsonPath('.outputData',,,true)}
would not be valid. - For function
${_formatDate(['date_time', 'format', day_offset, use_business_days, hour_offset, minute_offset, timezone])}
, usage${_formatDate('2018-09-01','',0,true)}
would be valid, whereas${_formatDate('2018-09-01','',,true)}
would not be valid.
- For function
- All functions allow nesting to two levels. That is, a function can be an argument to another function, which itself can be an argument to another function.
- You must use a double underscore preceding the name of a first-level nested function.
- You must use a triple underscore preceding the name of a second-level nested function.
For example, for 2nd day of next month less one Business Day:
${_formatDate('${__dayOfMonth(2,'${___dateadv('yyyy-MM-dd',0,1)}')}','',-1,true)}
Function Categories
Functions are listed alphabetically within the following categories on this page:
- Conditional Functions
- Credential Functions
- Database Connection Functions
- Date Functions
- Mathematical Functions
- Output Functions
- Other Task Functions
- SAP Connection Function
- Script Functions
- SQL/Stored Procedure Functions
- String Functions
- System Functions
- Universal Task Functions
- Web Service Functions
Conditional Functions
Return Conditional Value Depending on Equality of String Parameters
Description | Returns a conditional value depending on the equality of two string parameters. |
---|---|
Syntax |
|
Parameters |
|
Examples | ${_ifEqual('abc','def','YES','NO')} ${_ifEqual('abc','ABC','YES','NO',true)} |
Return Conditional Value Depending on Value of Boolean Parameter
Description | Returns a conditional value depending on the value of a boolean parameter. |
---|---|
Syntax |
|
Parameters |
|
Example | ${_ifTrue(${__isToday('Mon', 'E')},'20:00','22:00')} |
Credential Functions
Return Key Location of a Credential
Description | Returns a token representing the Credentials#Resolvable Credentials Key Location that you want to embed. |
---|---|
Syntax |
|
Parameters |
|
Example |
|
Return Passphrase of a Credential
Description | Returns a token representing the Credentials#Resolvable Credentials Passphrase that you want to embed. |
---|---|
Syntax |
|
Parameters |
|
Example | ${_credentialPassphrase('RCredentialXYZ')} → $(ops_unv_cred_passphrase_c89e7b2caf4247909bc46041df8a2643)
|
Return Token of a Credential
Description | Returns a token representing the Credentials#Resolvable Credentials Token that you want to embed. |
---|---|
Syntax |
|
Parameters |
|
Example | ${_credentialToken('RCredentialXYZ')} → $(ops_unv_cred_token_c89e7b2caf4247909bc46041df8a264
|
Return User Name of a Credential
Description | Returns a token representing the Credentials#Resolvable Credentials Runtime User that you want to embed. |
---|---|
Syntax |
|
Parameters |
|
Example |
|
Return User Password of a Credential
Description | Returns a token representing the Credentials#Resolvable Credentials Runtime Password that you want to embed. |
---|---|
Syntax |
|
Parameters |
|
Example |
|
Database Connection Functions
Returns Property of a Database Connection
Description | Returns a token representing the property associated with a Database connection. |
---|---|
Syntax |
|
Parameters |
|
Example |
|
Date Functions
Checks if Date Argument Equals Today's Date
Description | Checks if a date argument is equal to today's date in the specified format. |
---|---|
Syntax |
|
Parameters |
|
Examples | ${_isToday('Wed', 'E')} ${_isToday('${__dayOfMonth(1,'','',true)}')} |
Resolve to Current Date and Time
Description | Resolves to the current date and time. |
---|---|
Syntax |
|
Parameters |
|
Examples | ${_date} --> 2012-07-14 12:43:06 -0400 ${_date()} --> 2012-07-14 12:43:06 -0400 ${_date('yyyy-MM-dd', 5)} --> 2012-07-19 ${_date('yyyy-MM-dd HH:mm:ss', -2, -1)} --> 2012-07-12 11:43:06 ${_date('', 0, 0, 10)} --> 2012-07-14 12:53:06 -0400 |
Resolve to Current Date and Time (Advanced)
Description | Resolves to the current date and time. |
---|---|
Syntax |
|
Parameters |
|
Examples | ${_dateadv} --> 2012-07-29 09:31:42 -0700 ${_dateadv('yyyy-MMM', -1)} --> 2011-Jul ${_dateadv('yyyy-MMM', 0, -1)} --> 2012-Jun |
Resolve to Current Unix Epoch Time
Description | Resolves to the current time in milliseconds since Wed Dec 31 1969 19:00:00 GMT-0500 (EST) – the start of Unix epoch time. |
---|---|
Syntax |
|
Parameters | n/a |
Return Date with Offsets
Description | Returns the date after applying offsets. Optionally, can specify the output format. Whether a holiday is treated as a business day or a non-business day is specified by the #Exclude Holidays for Business Days Universal Controller system property. |
---|---|
Syntax |
|
Parameters |
|
Example | ${_formatDate} --> 2018-08-24 15:37 ${_formatDate()} --> 2018-08-24 15:37 ${_formatDate('','MMddyyyy',5)} --> 08292018 ${_formatDate('2018-09-01','',5)} --> 2018-09-06 ${_formatDate('2018-09-01','',-5)} --> 2018-08-27 ${_formatDate('2018-10-13 12:13:14 -0400','',5,true,0,0,'Australia/Sydney')} --> 2018-10-14 03:13:14 +1100 |
Return Date with Offsets (Advanced)
Description | Returns the date after applying offsets. Optionally, can specify the output format. Whether a holiday is treated as a business day or a non-business day is specified by the Exclude Holidays for Business Days Universal Controller system property. |
---|---|
Syntax |
|
Parameters |
|
Examples | ${_formatDateAdv} --> 2012-08-24 15:55 ${_formatDateAdv()} --> 2012-08-24 15:55 ${_formatDateAdv('','MMddyyyy',1)} --> 08242013 ${_formatDateAdv('2012-09-01','',0,1)} --> 2012-10-01 ${_formatDateAdv('2012-09-01','',0,-1)} --> 2012-08-01 ${_formatDateAdv('2012-09-01','',0,0,5,false)} --> 2012-09-06 |
Return Date with Time Zone
Description | Returns the Date and Time in another time zone. |
---|---|
Syntax |
|
Parameters |
|
Examples | ${_formatDateTz('2018-10-13 01:02:03 -0400', 'Australia/Sydney')} --> 2018-10-13 16:02:03 +1100 ${_formatDateTz('2018-10-13 01:02:03 -0400', 'Australia/Sydney','yyyy-MM-dd HH:mm Z')} --> 2018-10-13 16:02 +1100 ${_formatDateTz('${ops_launch_time}', '${ops_time_zone}')} = ${_formatDateTz('2018-06-13 15:35:00 -0400', 'Europe/Berlin')} = 2018-06-13 21:35:00 +0200 |
Return Day of Week
Description | Returns the day of week for the specified date as a number. |
---|---|
Syntax |
|
Parameters |
|
Example | ${_dayOfWeek} --> 6 ${_dayOfWeek()} --> 6 ${_dayOfWeek('2012-07-04')} --> 4 ${_dayOfWeek('2012-07-04', 'mon')} --> 3 |
Return Days between Dates
Description | Returns the number of days between date1 and date2.
The start date is inclusive, but the end date is not. |
---|---|
Syntax |
|
Parameters |
date1 and date2 are specified in any of the following formats:
|
Example | ${_daysBetween('2012-08-01','2012-09-01')} --> 31 |
Return Non-Business Day of Month
Description | Returns the Nth non-business day of month for the month of the date specified. Optionally, can start from the end of the month. Whether a holiday is treated as a business day or a non-business day is specified by the Exclude Holidays for Business Days Universal Controller system property. |
---|---|
Syntax |
|
Parameters |
|