Kourier Integrator Online Help

Export Formulas

Export formulas can be used to derive values from information stored in the current field or the current record being processed. An export formula can contain an arithmetic, logical, or string expression, a BASIC function, an external subroutine call or almost any other type of BASIC statement. Conceptually, an export formula provides the same functionality as I-type dictionaries without the need to create permanent dictionaries and the freedom to use standard BASIC syntax.

The following table lists the most common system variables used in an export formula:

Variable Name

Description - Usage - Notes

@ID

For U2 to SQL/File or REST Exports, this variable will contain the item-id of the record that is currently being processed.

For ODBC to SQL/File or Flat-file Exports, this variable will always contain an empty string.

@RECORD

For U2 to SQL/File or REST Exports, this variable will contain the contents of the record that is currently being processed.

For ODBC to SQL/File or Flat-file Exports, this variable will contain the contents of the row that is currently being processed. The data from each Source Column is copied into the attribute corresponding to the Line number of the field specified in the export.

FIELD$

For U2 to SQL/File or REST Exports, this variable will contain the contents of the dictionary or the attribute, value or sub-value referenced in the Field/Position column in the export, in internal format (e.g. the variable may contain system delimiters). If a literal value was specified in the Conversion column, this variable will contain that value.

For ODBC to SQL/File or Flat-file Exports, this variable will contain the value referenced by the Source Column, in external format. If a literal value was specified in the Conversion column, this variable will contain that value.

Use this variable to return information to the Kourier export engine.

FILENAME$

For U2 to SQL/File or REST Exports, this read-only variable will contain the primary Export Data File name as defined in the export. For REST exports, if the Export Data File name contains a substitution expression, this variable will contain the fully processed substitution expression (e.g. if the value of a parameter named Location is FLA and the Export Data File field contains the string {%Location_DEALS} this variable will contain the string FLA_DEALS).

For ODBC to SQL/File or Flat-file Exports, this read-only variable will contain the Source Table name specified in the export. If the Source Table name contains a substitution expression, this variable will contain the fully processed substitution expression.

SKIP$

This variable can be set to indicate that the current record being processed should not be included in the dataset being built by the export.

Cautions

You should avoid using any BASIC statements or functions that will stop the processing of a BASIC subroutine. Examples are STOP or ABORT. Instead, you should return an appropriate value in the FIELD$ variable. 

If you use equated constants to access attributes in a dynamic array (i.e., @RECORD<CUSTOMER.NAME>), you may not be able to use this coding technique in a Kourier formula depending on the configuration of the Kourier website (see ValidateRequest key). By default, .NET will see @RECORD<CUSTOMER.NAME> as an attempt to do "cross site scripting".  You can trick .NET into allowing this coding technique by entering a space character after the < and before equated constant (e.g., @RECORD< CUSTOMER.NAME >).

Examples