Variable

Action or Value

Example

[TABLE(Name|RowNum|ColName)]

Returns value at Row/Col within table by table name. Or returns JSON object with values if Row=0 or ColName blank.

For a table named Table1:


Name   Number   Other

------------------------

Smith  123      Any

Jones  345      OtherVal




[TABLE(Table1|1|Name)]  = Smith
[TABLE(Table1|2|Other)] = OtherVal
[TABLE(Table1|1|Number)]= 123


For a complete row:

[TABLE(Table1|1)]= [{ "LineNumber": "1", "Name": "Smith"},{ "LineNumber": "1", "Number": "123"}, { "LineNumber": "1", "Other": "Any"}]


For all values in a column:

[TABLE(Table1||Number)]= [{ "LineNumber": "1", "Number": "123"}, { "LineNumber": "2", "Number": "345"}]




[LINEITEMSCOUNT()]


[LICOUNT()]

Returns the number of line items for the current Record

[LINEITEMSCOUNT()] = 4

[LINEITEMS()]


[LI()]

Returns a JSON collection of all line items for the current Record.


This is typically used along with the OBJPROP command to gather data from line items.

{Quantity: 1, Description: "Part 123", Amount: "$123.45"}

[LINEITEMS(0|Amount)]


[LI(0|Amount)]

Returns all values from the Amount column for all line items as a JSON object.

[{Amount: 1},{Amount: 10},{Amount: 5}]

[LINEITEMS(0|Amount|,)]


[LI(0|Amount|,)]

Returns all values from the Amount column for all line items as a delimited string.


Typically used with SUM, MIN, MAX, AVG commands

1,10,5

[LINEITEMS(#|Amount)]


[LI(#|Amount)]


Returns the Amount value from line item #

{Quantity: 1, Description: "Part 123", Amount: "$123.45"} = "$123.45"

[LINEITEMS(1)]


[LI(1)]

Returns the entire line item # as a JSON object.

{Quantity: 1, Description: "Part 123", Amount: "$123.45"}

[TOLINEITEMS(StringToPars|LineDelimiter| ColumnDelimiter|SkipLines|LineNumberOffset|field,field,field|Command)]

Parses out a text blob and places the data elements into the line items of the current Record.


StringToParse = The string blob to parse

LineDelimiter = The character to use to split each line

ColumnDelimiter = The character to use to split each element of each line

SkipLines = The number of lines at the top of the blob to skip while processes to handle header rows (default = 0)

LineNumberOffset = The line numbers to skip so you can add data to the end of existing line iems (default = 0)

field... = list of field names to use for the columns . Blank field names are skipped)

Command = The command to use for each line. Useful to evaluate the line as to whether or not to process it

[TOLINEITEMS(Make,Model,Qty~Ford,Mustang,2~Ford,Taurus,10|~|,|1|0|Make,,Quantity|<<IF(<<line>>|C|SKIP||<<line>>)>>)]


This example parses out the text using ~ for lines and , for columns. It skips the first line and does not skip any line item numbers. 


It saves the Make and Qty columsn into the Make and Quantity line item fields and skips the Model column completely.


Each line is compared to see if they contain the work SKIP. If they do they are blanked out so a line item will not be added for it. If it does not contain SKIP then the line is processed.

[LOOP(coll|del|command)]


Warning: This command is in test/beta mode and may change before being fully released!

Loops through the provided collection, performs the given command for each item and adds the output to a string delimited by the given delimiter


coll = Collection to process


del = Delimiter to use for return values


command = Command to run for each item in collection - including all required parameters. Command and all embedded commands must be encoded with << and >> instead of [ and ] so it is not processed before the loop!


Also, in order to insert the object from the loop into your command, use <<LOOPOBJ>>.


[LOOP([{name: ""golden girls""},{name: ""family feud""},{name: ""threes company""}]|;|<<PROP(<<RESTGET(http://api.tvmaze.com/search/shows?q=<<PROP(<<LOOPOBJ>>|name)>>)>>|0|show|name)>>)]


The above variable will loop through the collection of TV shows, extract the "name" property (<<PROP(<<LOOPOBJ>>|name)>>)\, call the REST endpoint to retrieve the proper show name and return them all in a string separated by ;.


Output: 

The Golden Girls;Celebrity Family Feud;Three's Company

[LOOPCTR]

When used with work trigger loop action, this is the iteration # for the loop.


[LOOPOBJ]

When used with work trigger loop action, this is the object that represents the current iteration of the looping collection.