Advanced Variables
Variable |
Action or Value |
Example |
[OCRDATA(DocID|Page|X|Y|W|H|Pattern| MatchNum|word|type)] [BARCODEDATA(DocID|Page|X|Y|W|H|Pattern| MatchNum|word|type)] |
Looks up OCR or Barcode data for the given document/page in the given region (X, Y, W, H). If a REGEX pattern is provided then the specified match number is returned. DocID = ID of document in which to look for values Page = Page number in the document to look X = The Left coordinate of the region in which to look for values. * Y = The Top coordinate of the region in which to look for values. * W = The Width of the region in which to look for values. * H = The Height of the region in which to look for values. * Pattern = The REGEX pattern to use to look for a match. IMPORTANT: Be sure to wrap the REGEX in ignore codes - [~ ~] - so it is not replaced as a variable. For instance [~[a-zA-Z]~] will specify a REGEX pattern that will only return alpha characters. MatchNum = The REGEX match number to return. If more than one set of characters in the region matches your pattern then you can specify which one you want. MatchNum of 0 means all matches, 1 = first match and so on. word = Return values word by word instead of line by line type = return only words of the specified type - 0 = ALL - 1 = Number - 2 = Date * To look in the entire page, leave thee value blank |
[OCRDATA(123|1|1560|175|80|35|\d+)] - Look in the OCR data for doc id 123 / page 1 / region 1560,175,80,35 and return only numbers. [BARCODEDATA(123|1|1560|175|80|35|\d+)] - Look in the BARCODE data for doc id 123 / page 1 / region 1560,175,80,35 and return only numbers. [OCRDATA(123|1)] - Return all OCR data for doc id 123 / page 1. |
[COORDS(DocID|Page|Pattern|MatchNum|X|Y|W|H)] [OCRCOORDS(DocID|Page|Pattern|MatchNum|X|Y|W|H)] [BARCODECOORDS(DocID|Page|Pattern|MatchNum|X|Y|W|H)] |
Returns the coordinates on the page that match the text supplied. Returns 6 comma-delimited values of left, top, width, height, right, bottom. COORDS looks for both OCR/Barcode values OCRCOORDS only looks for OCR values BARCODECOORDS only looks for Barcode values DocID = ID of document in which to look for values Page = Page number of the document to look in Pattern = The text to find or the REGEX pattern to use to look for a match. IMPORTANT: If you use a REGEX pattern, be sure to wrap the REGEX in ignore codes - [~ ~] - so it is not replaced as a variable. For instance [~[a-zA-Z]~] will specify a REGEX pattern that will only return alpha characters. MatchNum = The REGEX match number to return. Leave this blank if you are just doing a standard text match. If more than one set of characters in the region matches your pattern then you can specify which one you want. MatchNum of 0 means all matches, 1 = first match and so on. Default = 0. X = The Left coordinate of the region in which to look for values. * Y = The Top coordinate of the region in which to look for values. * W = The Width of the region in which to look for values. * H = The Height of the region in which to look for values. * * To look in the entire page, leave these values blank |
Text match: [COORDS(123|1|Please Sign Here)] = 10,20,30,40,40,60 REGEX match: [COORDS(123|1|This (is a test)|1)] = 10,20,30,40,40,60 |
[OCRTABLE(DocID|Page|X|Y|W|H| RowPattern|IncludeRowMarker|Col^Col)] |
Extracts table data from a page's OCR data based a defined row delimiter and column pixel offsets. DocID = ID of document in which to look for values Page = Page number of the document to look in X = The Left coordinate of the region in which to look for values. * Y = The Top coordinate of the region in which to look for values. * W = The Width of the region in which to look for values. * H = The Height of the region in which to look for values. * * To look in the entire page, leave these values blank RowPattern = The text to find (including wildcards) or the REGEX pattern to use to find a row delimiter. Rows can be multiple lines and this gives yo a way to specify when a new row starts. IMPORTANT: If you use a REGEX pattern, be sure to wrap the REGEX in ignore codes - [~ ~] - so it is not replaced as a variable. For instance [~[a-zA-Z]~] will specify a REGEX pattern that will only return alpha characters. IncludeRowMarker - A true/false value specifying whether or not to include the row marker as a line in the returned table. Col^Col - A ^ delimited list of starting pixel offsets for each column. Add as many as you need for all your columns. Be sure to separate each with a ^ character. |
[OCRTABLE(123|1|||||Line*|false|1^100^125^300^550)] |
[UNIQUEDATA(rtid|field|del)] |
Returns the unique values from a field in a Record Type rtid - ID of the Record Type to check field - The field whose values you wish to return del - The delimiter to place between each value. The default value is ; (semicolon) Use this with the SPLIT variable to loop through each value |
[UNIQUEDATA(1|VendorName)] - ACME;Test Co;RonCo [UNIQUEDATA(1|VendorName|^)] - ACME^Test Co^RonCo |
[MATCHLINES(lines|match)] |
Returns the lines from a multi-line string that match a specific pattern or text string. lines - The lines in which to search for matches match - The text or pattern to use for matching. Any liens that match this will be returned. match can be a simple text match, pattern match or a Regex match. Text Match - Any text string Pattern Match - You can use wildcards of * or ? to look for matches. * represents any number of any charafter where ? represents any single character. Regex - Use a value that starts with REGEX: and anything after that is the Regex pattern to match. If you use brackets [ or ] in your pattern then be sure to enclose the pattern in [~ and ~] so the brackets are not interpreted as variables. This is sometimes used with [DOCTEXT()] variables to look for lines in a text document. |
[MATCHLINES([Doctext(123|1)]|*signature*)] - Returns the lines in Document ID 123, page 1 that contain "signature" in them. [MATCHLINES([PageText]|REGEX:\$\d{1,10}\.\d{1,10})] - Returns the lines in the 'PageText' field that contain dollar amounts. |
[SQLGET(Connection|Username|Password|key| Command|sqlparam|...)] |
Executes a command (query) using the connection, username and password parameters to connect to the SQL server. If any data is returned it is brought back as a JSON object in string format. You can use the OBJPROP function below to get data out of the objects. connection: Valid SQL connection string. This may contain user id and password as well. username: The user that is being used to authenticate to the SQL server. If omitted then the connection string can supply the user name. If this is filled in then it will override the connection string user. password: The password of the user that is being used to authenticate to the SQL server. If omitted then the connection string can supply the password. If this is filled in then it will override the connection string password. key: In order to allow SQLGET to run on your server, this key value must match the server's SQLGetKey setting. If not then the SQLGET call will be aborted. See the examples for more information. command: the actual query or command to run. All variables must be contained in the query as there is no method to add SQL command parameters. sqlparam: A name and value pair separated by an equal sign (=), The left side of the = is the parameter name and the right side is the parameter value. These will be added to the SQL command parameter list before executing the SQL command. These are repeatable so you can add as many of these as you need in your call. Be sure you have added the parameter name to the command string or they will be ignored. See the third example for guidance. |
[SQLGET(server=(local);database=xyz;uid=dmUser;pwd=xyz;|||YourKeyHere|select FirstName, LastName from Users where ID=15)] [SQLGET(server=(local);xyz=dm;uid=dmUser;pwd=xyz;|||YourKeyHere|select FirstName, LastName from Users where ID=[UserID])] [SQLGET(server=(local);xyz=dm;uid=dmUser;pwd=xyz;|||YourKeyHere|select FirstName, LastName from Users where ID=@ID|ID=[UserID])] Notes: 1) Be careful that the username/password you use only has rights to perform what you wish them to perform. This will help mitigate your risks of abuse if you use variables. If you construct your SQL queries without parameters you must either NOT use variables in your string or lock down your access to not allow anything malicious. See this article on SQL injection for some good information. 2) SQLGET is only available on premise-based installations. It is not available for cloud systems. 3) You must enable SQLGET by adding a new AppSetting entry to your web.config file. This entry must have a secret key that is used to allow users to execute SQLGET on that server via the key parameter. <add key="SQLGetKey" value="YourKeyHere"/> The "YourKeyHere" value needs to be replaced with your secret key. This comparison is case sensitive to make sure you use the proper casing. If you change your key value then you must also update all your SQLGET calls or they will fail. |
[RESTGET(URL|Username|Password|reserved| isXml)] |
Calls a REST GET endpoint and returns the data as a JSON object in string format. You can use the OBJPROP function below to get data out of the objects. URL: The URL of the REST endpoint. Only GET commands are supported at this time so all your data must be in the URL. username: The user that is being used to authenticate to the REST service. You can omit this and password if the REST service is open and does not require authentication. password: The password of the user that is being used to authenticate to the REST service. You can omit this and username if the REST service is open and does not require authentication. reserved - Reserved option. Do not use. IsXML - true/false - Specifies that the return value from the REST call will be XML. The system will then attempt to convert the XML into JSON so the return from this call is still a JSON format. |
Open REST calls (without authentication): [RESTGET(http://api.tvmaze.com/search/shows?q=the+golden+girls)] [RESTGET(http://echo.jsontest.com/return/me)] REST calls with authentication: [RESTGET(https://beta.xyz.com/rest/records/search?searchString=test&pageNum=1&numPerPage=1|admin|admin)] REST calls with XML returned: [RESTGET(https://beta.xyz.com/rest/records/search?searchString=test&pageNum=1&numPerPage=1||||true)] |