InLine Functions

<< Click to Display Table of Contents >>

Navigation:  Trigger Actions >

InLine Functions

The field replacement %func% can be used to execute a number of inline functions. The function will be executed and the returned value replaced. InLine functions can be used on any action entry as with fields/variables.

 

The format of inline functions is %func%:FunctionName(Value[,parameter][,parameter])

 

The 'value' & parameters can be any fixed text or a %field% extracted field/variable replacement.

 

For example, in the text:

 

'Dear %func%:ToProperCase(%fullname%),'

 

If %fullname% was set to 'john doe' - when replaced the text would be:

 

'Dear John Doe,'

 

The following functions can be used:

 

Upper(value)

Converts the value to uppercase.

Lower(value)

Converts the value to lowercase.

ToProperCase(value)

Capitalises each word in value.

Right(value,count)

Returns the rightmost 'count' characters in value.

Left(value,count)

Returns the leftmost 'count' characters in value.

IndexOf(value,seachtext)

Returns the character position where searchtext occurs in the value.

Clean(value)

Returns the cleaned version of value. All whitespace, control characters, blank lines are removed.

PlainText(value)

Returns the plaintext version of value. If value contains HTML then all HTML tags are removed.

Trim(value)

Returns the trimmed version of value.

SubString(value,start [,number])

Returns the substring of value starting as position specified in start. If number is specified then the number of characters from the start position is returned, otherwise the characters from start until the end of the value are returned.

Replace(value,find,replacewith)

Returns the value with the find parameter replaced with the replacewith parameter.

PadLeft(value,characters)

Returns the value padded with spaces to the left if required to reach the total number of characters.

PadRight(value,characters)

Returns the value padded with spaces to the right if required to reach the total number of characters.

Format(value,mask)

Returns the formatted value using the mask.

Length(value)

Returns the number of characters contain in the value.

Asc(value)

Returns the ascii character code of the first character in value.

Chr(value)

Returns the ascii character for the ascii code specified in value.

EmailAddress(value)

Returns the first email address found in value.

Url(value)

Returns the first URL found in value.

Base64Encode(value)

Returns the base64 encoded version of value.

Base64Decode(value)

Returns the text value of the base64 encoded value.

URLEncode(value)

Returns the URL encoded version of value.

URLDecode(value)

Returns the text value of the URL encoded value.

DateAdd(value,interval,number)

Returns a date with number of days, months, seconds or years added. The interval should be s=seconds,n=minutes,h=hours,d=day,yyyy=years.

DateDiff(interval,date1,date2)

Returns a numeric value for the interval between date1 and date2. The interval should be s=seconds,n=minutes,h=hours,d=days,ww=weeks,yyyy=years.

Day(value)

Returns the day number if value is a date.

Month(value)

Returns the month number if value is a date.

MonthName(value)

Returns the month name if value is a date.

Year(value)

Returns the year number if value is a date.

HyperLink(value,linktext)

Returns a HTML <a> ref. The first URL or email address found in value will be used for the link url. The linktext parameter will be used for the hyperlink text if specified.

PlainTextToHTML(value)

Returns HTML from plaintext. Converts all line-feed characters to <br />, encodes special characters and encloses any URLS or email addresses in <a> tags.

 

Hyperlink examples:

 

'Click %func%:HyperLink(%msg_viewurl%,Here) To View The Message'

 

Would be replaced with:

 

'Click <a href='http://thinkautomationserver.mydomain.com/ThinkAutomation/viewmessage.aspx?id=BD2B1E71698B90C65F6304404DBF9D8F6D4997A3A6' target='_blank'>Here</a> To View The Message'

 

Or with email address

 

'Click %func%:HyperLink(%msg_from%,Here) To Send Email'

 

Would be replaced with:

 

'Click <a href='mailto:sales@mydomain.com' target='_blank'>Here</a> To Send Email'

 

 

DateDiff Example

 

'Days Since Order %func%:DateDiff(d,%OrderDate%,%msg_date%)'

 

Would be replaced with:

 

'Days Since Order 10'

 

For date functions you can use 'date' or 'now' as the parameter text. 'date' will be replaced with the current system date, 'now' will be replaced with the current system date and time.

 

ThinkAutomation © Parker Software 2016