Question:

I notice that certain ATC commands (ATC: IF, ATC: SET, ATC: SETHTML, and ATC: EXIT WHEN) accept “value expressions”.  What are the possible value expressions that can be used with these commands?

Answer:

Value Expressions

The following value expression are supported by the ATC commands listed above.

  • @.fieldname specifies a value from a field in the current row of the FOREACH loop
  • TargetRow.fieldname specifies a value from a field in the current TargetRow
  • tablename.fieldname specifies a value from a field in the source document
  • # (number sign) has special meaning when used with DocNo: indicates that the document number should be reassigned to the next available value during the next save.
  • * (asterisk) indicates that the value should be copied from the source document.
  • EMPTY sets the field to blank/empty.
  • NULL indicates a NULL value for the field.
  • BeforeChange( tablename.field ) returns the value of the field prior to the pending change. This only makes sense after an IsChanging test. Note: The space after the open parenthesis is required!
  • Compute( tablename, expression [,filter] ) returns the expression evaluated for all rows in the specified table, or those rows that match the optional filter.  All three parameters can be a variable, bookmark or string constant.  Expression and Filter must conform to the syntax for .NET Data Expressions.  Note the space after the open parenthesis: it helps the parser and is essential if any periods appear in the expression or filter.
  • Concatenate( value,value [,…,value ) returns the concatenation off all the values, each of which can be a variable or bookmark or string constant.  Note the space after the open parenthesis: it helps the parser and is essential if any of the concatenated segments includes a period.   Commas as well as leading and trailing white spaces are removed from the segments, so include:
    • \b for a space
    • \c for a comma
    • \cp for a close parenthesis
    • \n for a new line
  • FormatResult(value, format ) returns the value formatted as specified
    • Numeric formats, including (for example) N0, C2, F1, P3, # and 0
    • Date formats (see .NET specification)
    • Mask formats (for example Kxxx-xx-xxxx)
  • LookupResult( dvname, value, dependson1, dependson2, dependson3 ) returns a value based on a scalar lookup (sort of like the Microsoft Excel VLookup function). See an example below.
    • dvname is the name of a lookup result. See the Lookup Result Validation Names section of  KBA-01535.
    • value is the value to look up, either a bookmark or a variable.
    • dependson1-3 are all optional and provide input values, either as bookmarks or variables
  • NOW() specifies that the current date and time should be used.
    • +n.n can follow NOW() to add a number of days (with decimal) to the current date.
  • SUBSTRING( source, start, length ) returns the portion of the string requested.  Source and start are required arguments; length is optional. 
  • new value specifies the value to be stored for the field.
    • [bookmark] specifies a Word Template bookmark. The square brackets are required.

 

Related KBAs:

  • KBA-01759: Validation and Document Logic Overview
  • KBA-01777: The Workflow Scripts Tool
  • KBA-01778: How to Create a New ATC Workflow Script
  • KBA-01779: How to Associate an Event with a Workflow Script
  • KBA-01780: How to Create Workflow on a Document
  • KBA-01781: How to Create Workflow in a Predefined Route
  • KBA-01782: The Index of ATC Commands
  • KBA-01784: Examples of ATC Workflow Scripts

KBA-01783:Last updated: June 9, 2026 at 12:33 pm;  green text = new

Related Post