Expressions in Linnworks is a way of outputting data from the system based on a mathematical or functional expressions. This functionality applies to printing functions (printing invoices, labels), generating emails, running macro scripts and data export/import automation.
For example if you wanted to create a new field on an invoice which will contain some calculated value you can use Output Formula Value in the text field in the Template Designer and code the expression to output the desired result.
Performs a boolean Not operator on the parameter a. For example, Not[true] = false.
Evaluates a Rule Basic string. I think this is an interesting operand function. In my Rules Engine, I may have rules that return a Rules Basic string. Then the result could be evaluated with this operand
function. That is, have rules that create other rules. Example: eval[concat["a:=5;", "b:=6;", "a+b"]]
Performs an if-else-end
Returns true/false indicating if the parameter is all digits. For example, IsAllDigits["1234"] = true
Indicates is the parameter is null or empty.
Indicates if the parameter has the value true or is null;
Indicates if the parameter has the value false or is null
Calculates the absolute value of a numeric parameter.
Calculates the average of a list of numbers. The list items must be able to convert to doubles.
Indicates if a value is between the other values. Please note that the comparison is inclusive.
Finds the maximum numeric value in a list
Calculates the median for a list of numbers
Finds the numeric minimum value in a list
Returns numeric value, 2 decimal places. For example N2[100/3] returns 33.33
Rounds a numeric value to the number of decimal places
Calculates the sin of a number
Calculates the square root of a number.
This operand function concatenates the parameters together to make a string.
Indicates if the item is contained in the list.
Returns a double quote
Returns the index of a list item.
Joins a list of items together using a delimiter.
Returns the left number of characters from a string parameter.
Example for Template Designer:
Pads a string on the left with new values
Returns the length of a string
Converts a string to lower case
Finds the maximum string in the list
Finds the minimum string in the list
Converts a string to Proper Case. For example, the proper case of "buFFalo" "Buffalo"
Removes the specified characters from the string
Example For Template Designer
EVAL{BEGIN}Replace[[{ExternalReference}], "MAGENTO",""]{END}
Replaces one string with another string
Returns the right number of characters from a string parameter
Pads a string on the right with new values
Trims the spaces from the right of a string
Searches for a string within another string at a specified starting position
Extracts a substring from a string
Trims the spaces from the entire string. Please note that it does not remove spaces from the text itself, it only removes spaces from the start and the end of the string. In order to remove spaces from the text, please consider using replace[]
Converts a string to upper case
Adds an amount to a date. Please note that the amount may be negative.
Returns the day of a date
Returns a day string. For example dayofweek[today[]] returns Wednesday.
Note: dayofweek[now[]] will not work. Use dayofweek[nowf[]] instead.
Returns numeric value. For example hour[nowf[] returns 12.
Returns the maximum date in the list
Returns the minimum date in the list.
Returns the month of a date
Create a new date data type
Returns the current date
Returns current time. For example NowF[] returns 2013-06-12 12:42:22
Returns current time. For example:
Nowfd[""] returns 21/06/2013 12:42:22 (default format)
nowfd["ddd, dd MMM yyyy HH:mm:ss zzzz"] returns Fri, 21 Jun 2013 16:55:50 +01:00 (RFC 2822 format)
nowfd["dddd, dd MMM yyyy HH:mm:ss zzzz"] returns Friday, 21 Jun 2013 16:55:50 +01:00
For more info please visit: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspx
ParseDateTime[date, inputformat , outputformat]
Returns a given the date in the outputformat specified.
ParseDateTime["2013-08-18","yyyy-MM-dd","MMM dd yyyy"] returns Aug 18 2013
ParseDateTime["8/18/2013","M/d/yyyy","d/M/yyyy HH:mm:ss"] returns 18/8/2013 00:00:00
The inputformat needs to match the date/time format on your machine. To retrieve the current format of your dates, e.g. the dReceievedDate, use EVAL{BEGIN}[{dReceievedDate}]{END}
Example: ParseDateTime[[{dReceievedDate}], "dd/MM/yyyy HH:mm:ss", "dd MM yyyy"] returns 18 08 2013
Returns today's date. For example Today[] returns 2013-06-12
Returns the year of a date