Functions

<< Click to Display Table of Contents >>

Navigation:  NITRO™ Workflows > Configuring Workflows > Conditions, Placeholders & Functions >

Functions

Functions

 

Add

This function performs the sum of two values or adds a given time span to a date time object.

 

Syntax:

Column Value: $add(ColumnValue,ColumnValue)

Column name: $add(([ColumnDisplayName|ColumnInternalName]),Days:Hours:Minutes:Seconds)

Query List: $add(QuerylistActionName##FieldInternalName,ColumnValue)

Variable: $add(WFActionName##FieldInternalName,ColumnValue)

Example

Column Value - $add(97, 3)

Column name - $add([Due Date|DueDate],2:0:0:0)

Query List - $add(GetPurchaseItem##Price,100)

WF Variable - $add(WFaction##Price,[TaxAmount| TaxAmount])

 

Note

Source and Target columns should be either Number or currency columns.

 

Addmonths

 

This function adds a given number of months to a date time.

 

Syntax

$add([ColumnDisplayName|ColumnInternalName],Value)

 

Example

$addmonths([Due Date|DueDate] ,5)

 

Note

Target field should be a Date Time column.

 

 

Calcbusinesstime

 

This function adds business time to a given date time.

 

Syntax

Column Name: $calcbusinesstime([ColumnDisplayName|ColumnInternalName],Days:Hours:Minutes:Seconds)

 

Example

$calcbusinesstime([Created|Created],2:0:0:0)

 

Note

Target column should be a Date Time column

 

Calcdate

 

This function adds specific values to a date time object.

 

Syntax

$calcdate(([ColumnDisplayName|ColumnInternalName]),number, Days/Weeks/Months/Years)

 

Example

$calcdate([Due Date|DueDate],5,Months)

$calcdate([Due Date|DueDate],5,Days)

 

Note

Works with only Date Time columns.

 

 

Extractheaders

 

This function gets a collection of key value pairs from a value based on separator. It can only be used in WF Variable action.

 

Syntax

$extractheaders(seperator,[FieldDisplayName|FieldInternalName],firstupper/upper/lower)

 

Example

$extractheaders(:,[Mapping|Mapping],firstupper)
In Field Mappings: WFVar##KeyName

 

Note

Comma can't be used like separator as it is used as function parameters separator.

 

 

Formatvalue

 

This function returns the given lookup or user column display value.

 

Syntax

$formatvalue([Placeholder])

 

Example

$formatvalue([Requester|Requester])

 

Note:

Target column type should be string.

Supported Columns in Parameters: lookup, person or group

More than two parameters can be used in this function.

 

 

Lookupid

 

This function returns the given lookup/user column’s ID.

 

Syntax

$lookupid([ColumnDisplayName|ColumnInternalName])

 

Example

$lookupid([Requester|Requester])

 

Me

 

This function inserts or updates the destination column with the current logged in userid.

 

 

Parselookupvalue

 
This function is used in column mappings (create/update item) to set the value for a lookup column.
The function will try to get the item from lookup list with the text value given as parameter and returns the first item matching that value.

Syntax:

Column Value: $parselookupvalue(LookupColumnValue)

Column name: $parselookupvalue([ColumnDisplayName|ColumnInternalName])

Query List: $parselookupvalue(QuerylistActionName##FieldInternalName)

Variable: $parselookupvalue(WFActionName##FieldInternalName)

Example

Column value - $parselookupvalue(Calendar)

Column name - $parselookupvalue([Title|Title])

Query list place holder - "$parselookupvalue(ConfigurationItem##Title)"
WF variable place holder - "$parselookupvalue(UsersVariable##Value)"

Note

This function is only used in field mappings and the target column should be a lookup column.

 

 

Parseuservalue

 

This function is used in column mappings(create/update item) to set the value for a user column.
The function will try to ensure user from web.

 

Syntax

$parseuservalue(User Display Name/Alias/Email Address)

 

Example

$parseuservalue(james@crowcanyon365.com)

 

Note

This function can be used only in field mappings and the target field should be User field.

 

 

Product

 

This function performs the product of (multiplies) two values.

 

Syntax:

Column Value:  $product(ColumnValue,ColumnValue)

Column name:  $product(([ColumnDisplayName|ColumnInternalName]), ([ColumnDisplayName|ColumnInternalName]))

Query List:  $product(QuerylistActionName##FieldInternalName,ColumnValue)

Variable:  $product(WFActionName##FieldInternalName,ColumnValue)

 

Example

Column Value - $product (25, 5)

Column name - $product([Price|Price],[Quantity|Quantity])

Query List - $product(GetPurchaseItem##Price,2)

WF Variable - $product(WFaction##Price,5)

 

Note

The values used in the function should be number values or should be resolved to numbers and

target column should be number or currency field

 

 

Regextract

 

This function is used to extract a pattern value from a string using regex expression.

 

Syntax

$regextract([ColumnDisplayName|ColumnInternalName],expression)

 

Example

$regextract([Subject|Subject],@.*\[CaseId: (.+)\].*)

 

Split

 

This function splits the string to a collection of strings using the separator. This can be only used in WF variable action.

 

Syntax

$split(separator, [ColumnDisplayName|ColumnInternalName])

 

Example

$split(:,[Title|Title])

 

Strcat

 

This function performs concatenation on given parameter values.

Syntax:

Column Value: $strcat(ColumnValue,ColumnValue)

Column name: $strcat((ColumnDisplayName | ColumnInternalName),ColumnValue/([ColumnDisplayName|ColumnInternalName]))

Query List: $strcat(QuerylistActionName##FieldInternalName,ColumnValue)

Variable: $strcat(WFActionName##FieldInternalName,ColumnValue)

Example

Column Value - $strcat(CrowCanyon ,rocks)

Column name - $strcat([Title|Title],new)

Query List - $strcat(GetPurchaseItem##Price,100)

WF Variable - $strcat(WFaction##Title,[Title|Title])

 

Note

Target column should be a text or Multi Line text column.

This function accepts more than two parameters.

 

 

Strlen

 

This function returns the length of the specified parameter return value.

Syntax:

Column Value: $strlen(LookupColumnValue)

Column name: $strlen([ColumnDisplayName|ColumnInternalName])

Query List: $strlen(QuerylistActionName##FieldInternalName)

Variable: $strlen(WFActionName##FieldInternalName)

 
Example

Column value - $strlen(crowcanyon)

Column name - $strlen([Title|Title])

Query list place holder - "$strlen(ConfigurationItem##Title)"

WF variable place holder - "$strlen(UsersVariable##Value)"

 

Note

Target column should be number/currency/text.

 

Subtract

 

This function is used to subtract two values or subtract a given time span from a date time object.

Syntax:

Column Value: $subtract(ColumnValue,ColumnValue)

Column name: $subtract (([ColumnDisplayName|ColumnInternalName]),Days:Hours:Minutes:Seconds)

Query List: $subtract(QuerylistActionName##FieldInternalName,ColumnValue)

Variable: $subtract(WFActionName##FieldInternalName,ColumnValue)

Example

Column Value - $subtract(103, 3)

Column name - $subtract([Due Date|DueDate],2:0:0:0)

Query List - $subtract(GetPurchaseItem##Price,100)

WF Variable - $subtract(WFaction##Price,[Discount|Discount])

 

Note

Source and Target columns should be either Number or Currency or Date Time columns.

 

Sum

This function performs the sum operation on values returned from parameters.
This can only be used on query list action to sum the values from multiple items.

 

Syntax

 QuerylistActionName##$sum([FieldDisplayName|FieldInternalName])

 

Example

 GetPurchaseItem##$sum([Cost|Cost])

 

Today

 

This function inserts or updates the destination column with today's date.

 

Usercollection

 

This function gets the collection of users from different fields that can be mapped to a multi user column.

When configured in a WF Variable action, the collection of users returned can be used to create an item for each user.

 

Syntax

$usercollection([ColumnDisplayName|ColumnInternalName[ColumnDisplayName|ColumnInternalName]).

 

Example

$usercollection([Requester|Requester],[Staff|staff]).

 

Refer to Using User Collection for more information.

 

Note

Source column should be a person or group field.

 

 

 

Variablecollection

This function gets the collection of values from parameters and combines them into a single value by joining the collection of values with a separator. It can also be used to get the collection of column values from query list items.

 

Syntax

O365: $variablecollection(separator[ColumnDisplayName|ColumnInternalName])
OnPremises: $variablecollection[ColumnDisplayName|ColumnInternalName], separator)

 

Example

$variablecollection(;#,[Requester|Requester],[AssignedTo|AssignedTo])
 

Refer to Updating Approvers for a Change Request example that uses variable collection function.

 

Note

More than two parameters can be used in this function

 

 

Xpath

 

This function is used to navigate through elements and attributes in an XML.

 

Syntax

Column Name: $xpath([value/placeholder],xpath)

Query List: $xpath(QuerylistActionName##FieldInternalName,xpath)

WF Variable: $xpath(WFActionName##FieldInternalName,xpath)

 

Example

 

$xpath([xmlvalue|xmlvalue], /birds/parrot) – (If value of column ‘xmlvalue‘ is ‘<birds><parrot><color>green</color></parrot><pigeon><color>white</color></pigeon></birds> ‘, then computed value will be ‘<parrot><color>green</color></parrot>’)

 

$xpath(TicketItem##Xml,/Category/CategoryOwner)

 

$xpath(WFAction##Countriesxml,/country/city)

 

Note

To repeat attribute/element collection on a workflow action, this function should be configured in WF Variable action and can be used later in field mappings of create item action by using the syntax ‘@{CollectionValue}tag/attribute name’.

For single value, directly use full function.

 

For more details on function refer below articles

Comprehensive List Of Functions In NITRO Studio

Comprehensive List Of Functions In NITRO Studio – 2

Functions: GetGroupMembers And Join

Function: Get Column Value For Version

Function: Format Value 2

Function: Append In NITRO Workflows And Custom Actions