Table of Contents


Functions List

 

The following list describes functions available on the Magentrix platform. All required arguments are provided and described. Optional arguments (i.e. those that can be excluded from the function without returning an error) are indicated by square brackets.
 

Logical functions
 

{!IsNull(value)}
Returns True if the value is null, else False.

Ex. {!IsNull("Name")} Returns True if the Name field is empty, else False.
 

{!HasValue(value)}
Returns True if the value is not null, else False.

Ex. {!HasValue("PhoneNumber")} Returns True if the Phone Number field has a value, else False.
 

{!NullValue(expression,substitute)}
Returns the item if the item is not blank otherwise it will return the substitute.

Ex. {!NullValue("Name","Anonymous")} Returns the value of the Name field, or returns Anonymous if Name field is empty.
 

{!IsInRole("role")}
Returns True if the current user is assigned the security role specified in the string role, else False.

Ex. {!IsInRole("Administrator")} Returns True if the current user is assigned the Administrator, else False.
 

{!Equal(value1,value2)}
Returns True if value1 and value2 are equal, else False.

Ex. {!Equal(ProductPrice,50)} Returns True if the Product Price field has a value equal to 50, else False.
 

{!NotEqual(value1,value2)}
Returns True if value1 and value2 are not equal, else False.

Ex. {!NotEqual(ProductPrice,50)} Returns True if the Product Price field does not have a value equal to 50, else False.
 

{!LessThan(value1,value2)}
Returns True if value1 is less than value2, else False.

Ex. {!LessThan(ProductPrice,50)} Returns True if the Product Price field has a value less than 50, else False.
 

{!LessThanOrEqual(value1,value2)}
Returns True if value1 is less than or equal to value2, else False.

Ex. {!LessThanOrEqual(ProductPrice,50)} Returns True if the Product Price field has a value less than or equal to 50, else False.
 

{!MoreThan(value1,value2)}
Returns True if value1 is more than value2, else False.

Ex. {!MoreThan{ProductPrice,50)} Returns True if the Product Price field has a value greater than 50, else False.
 

{!MoreThanOrEqual(value1,value2)}
Returns True if value1 is more than or equal to value2, else False.

Ex. {!MoreThanOrEqual(ProductPrice,50)} Returns True if the Product Price field has a value greater than or equal to 50, else False.
 

{!If(expression,trueValue,falseValue)}
Returns trueValue if expression returns True, else falseValue.

Ex. {!If(Equal(Active,"true"),"Complete","Incomplete"))} Returns Complete if the Active checkbox is checked and returns Incomplete if the Active checkbox is not checked.
 

{!OR(value1,value2,…,valueX)}
Performs an OR operation on the boolean values; returns True if any value is True, else False.

Ex. {!OR(Equal(Active,"true"),Equal(Status,"open"))} Returns True if either the Active checkbox is checked or the Status is open, else False.
 

{!AND(value1,value2,…,valueX)}
Performs an AND operation on the boolean values; returns True if all values are True, else False.

Ex. {!AND(Equal(Active,"true"),Equal(Status,"open"))} Returns True if the Active checkbox is checked and the Status is open, else False.
 

{!Not(value)}
Returns the opposite boolean of value (i.e. True if value returns False, else False).

Ex. {!Not(Equal{Active,"true"))} Returns True if the Active checkbox is not checked, else False.
 


Date and time functions
 

{!ToUserTime(datetime)}
Converts DateTime value to the user's configured timezone
 

{!Today()}
Returns today's date as a DateTime value


{!$today}
Returns today's date (UTC), 12:00am


{!$now}
Returns the current UTC date/time

 

{!AddDays(date,days)}
Adds the value of days to the DateTime value date
 

{!AddDateTimePart(datetime,"part",value)}
Adds value to the specified DateTime part of the DateTime value datetime; returns the result
Part accepts: years, months, days, hours, minutes, seconds and ticks as values

Ex. {!AddDateTimePart(CreatedOn, "days", 5)} Returns the Created On date plus 5 more days.

 

Text functions
 

{!EscapeSingleQuote("str")}
Returns encoded value where single quotes are escaped.

{!FormatNumber(value, decimalPlaces)}
Returns a formatted string value with a number of decimal places. If no decimal places are provided, the number value will have digit separators but no decimal places.

{!FormatCurrency(value, currencyCode, decimalPlaces)}
Returns a formatted string value of a numeric or currency field, If no decimal places are provided, the number value will have digit separators but no decimal places.

{!FormatAddress(street, city, state, postalCode, country)}
Returns a formatted address text value based on values provided.

{!ToUpper("str")}
Returns a string where all characters of the string str are upper case.

Ex. {!ToUpper("Name") Returns value of the Name field in all upper case letters. 
 

{!ToLower("str")}
Returns a string where all characters of the string "str" are lower-case.

Ex. {!ToLower("Name") Returns value of the Name field in all lower case letters. 
 

{!Concat("str1","str2",etc.)}
Returns the concatenation of all provided strings

Ex. {!Concat("FirstName","LastName")} Returns values of the First Name and Last Name fields are side-by-side.
 

{!Contains("text","value")}
Returns True if text string value is found within the text string text, else False

Ex. {!Contains(Title,"Bicycle")} Returns True if the word Bicycle is found in the Title field, else False.
 

{!Replace("text","pattern","value",[ignoreCase])}
Finds all occurrences of string pattern within string text and replaces them with string value; optional parameter ignoreCase can be set to True to ignore character casing

Ex. {!Replace{"Body", "Today", "Tomorrow")} Replaces the word Today from the Body text with Tomorrow.
 

{!StartsWith("str","value")}
Returns True if the string "str" begins with the string value.

Ex. {!StartWith{Title, "New Release")} Returns True if the Title begins with New Release.
 

{!Len("str")}
Returns the length of the string "str".

Ex. {!Len{"PhoneNumber")} Returns the character length of the Phone Number field value.
 

{!Label("text")}
Returns a translated value of the specified label text provided in the Magentrix Translation Studio

Ex. {!Label("Title")} Returns a translated value of the Title provided in the Magentrix Translation Studio. 


Advanced functions
 

{!Add(value1,value2,value3)}

{!UrlFor(action,controller,parameters)}

Creates a web address (URL) based on a given action, controller and parameters.

Ex. {!UrlFor("create","account",[type="Partner"])} Creates URL for Create action on the Partner Account page.
 

{!ActivePageUrl("str",[para])}
Returns the Active Page URL of the Active Page with the name "str"; optional parameters can also be set.

Ex. {!ActivePageUrl{"StoreFront",[])} Returns the URL of the Active Page called Store Front.
 

{!UrlForAsset(relativePath)}
Returns the web address of the specified image found at relativePath.

Ex. {!UrlForAsset{"Images/Marketing/FullLogo.png")} Returns the web address of the image named FullLogo.png located in the Images folder > Marketing folder.
 

{!PageUrl()}
Returns the current page web address.
 

{!NewGuid()}
Returns a new unique value.
 

{!Encrypt(expression,[based64Encoding])}
Encrypts value and has an optional parameter to indicate whether the encoding should be in safe URL encoding or base64; the default setting is base64.

Ex.{!Encrypt("Password1!",[base64Encoding])} Encrypts Password1! into base64 encoding.
 

{!Encrypt(value, key)}
Encrypts the value given using the given key.

{!GetSiteUrl()}
Returns the current site/portal web address; depending on the user's usage the application may be in the portal mode and therefore the web address returned may change based on the portal or main application being browsed.

{!GetLogoUrl()}
Returns the logo URL of the current user's portal. You can use this account for different logos across your main portal and custom hubs in your email templates.
 

{!UrlEncode(value)}
Encodes value to be URL encoded.

Ex. (!UrlEncode{"A&A")} Encodes A&A into URL format (A%26A). 
 

{!UrlTokenEncode(value)}
Performs encoding for URL parameters (parts of a URL rather than the whole URL).
 

{!UrlParam(name)}
Performs encoding for URL parameters (parts of a URL rather than the whole URL).


<< Functions and Merge Field Case Scenarios | Standard Merge Fields List >>