Line Item Variables
Variable |
Action or Value |
Example |
[LINEITEMSCOUNT()] [LICOUNT()] [LICOUNT(where|name)] |
Returns the number of line items for the current Record This is very useful in looping workflow actions. where = Field name and value combination to limit the line items returned. Can be repeated as many times as necessary using ^ as a separator per field. You can use 3 elements for range searching. I.e. Amount=1 for only line items where Amount is set to 1. Amount=1=100 for only line items where Amount is between 1 and 100. You can also use <> to find lines where a variable is not set to a value. Wildcards are supported in both the name and the value of the 'where' logic. Matching is NOT case sensitive. name = The Named Record to use. This is ONLY valid in workflow operations. |
[LICOUNT()] = 4 [LICOUNT(Matched=Yes)] = 2 [LICOUNT(Matched=Y*)] = 2 [LICOUNT(Le*ers=AB*D)] = 1 Finds count of lines where any field that starts with 'LE' and ends with 'ERS' has a value that starts with 'AB' and ends with 'D'. |
[LI()] [LINEITEMS()] |
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"} |
[LI(#|Field)] [LINEITEMS(#|Field)] -or- [LINEITEMS(#|Field||likematch|where)] [LI(#|Field||likematch|where|name)] |
Returns a field value from the specified line item # = Line number of the value to return. Use 0 (zero) to return all lines' values. Field = Name of field to return likematch = Set to YES, Y, TRUE, or 1 to use LIKE syntax (with * as a wildcard) to find the proper variable name. where = Field name and value combination to limit the line items returned. Can be repeated as many times as necessary using ^ as a separator per field. You can use 3 elements for range searching. I.e. Amount=1 for only line items where Amount is set to 1. Amount=1=100 for only line items where Amount is between 1 and 100. You can also use <> to find lines where a variable is not set to a value. name = The Named Record to use. This is ONLY valid in workflow operations. |
[LI(1|Amount)] = 123.45 [LI(1|Amo*||Yes)] = 123.45 [LI(0|Amount)] = [{Amount: 123.45},{Amount: 10},{Amount: 5.02}] [LI(0|Amount|;)] = 123.45;10;5.02 [LI(0|Amo*|;|Yes)] = 1;10;5 [LI(0|Amount|||Amount=1=100)] = 12.45;10 |
[LINEITEMS(#)] [LI(#)] |
Returns the entire line item # as a JSON object. # = Line number of the values to return |
[LI(1)] = {Quantity: 1, Description: "Part 123", Amount: "$123.45"} |
[LINENUM(valfield|val|to|name)] |
Returns the first line number in the record where the field specified matches a value. field = Name of the line item field to look for val = the val that is in the field specified valto = IF specified then this is the TO of the range and val is the FROM of the range name = The Named Record to use. This is ONLY valid in workflow operations. |
[LINENUM(Amount|100)] = Returns first line number where the amount field = 100 [LINENUM(Amount|100|200)] = Returns first line number where the amount field is from 100 to 200. |
[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 columns 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. |