RESULT

Specifies the output results of an analytic script that you want to make available to end users in client applications.

Output results, even if they exist, are not automatically made available.

Syntax

//RESULT type name
  <description>

Parameters

Name Description
type

The type of result item:

  • TABLE – an Analytics table and associated data file (.fil)
  • LOG – an analytic log file
  • FILE – a non-Analytics file

Note

Specifying the LOG or FILE parameters causes data to be uploaded from an on-premise Robots Agent to the cloud-based Robots app in HighBond. For information about uploads to Robots, see Uploads to the cloud-based Robots app.

name

The name of the result item. The name value cannot contain any spaces.

Note

The name value must exactly match the name of the result item in the analytic script. You are not naming an item with name, you are matching a name specified in the script.

You can use wildcard characters in name to assist with matching a name in the script.

You cannot use a variable for name.

Table name

The name value specifies an Analytics table name. You must specify the table name, not the source data file name.

Correct:

//RESULT TABLE Missing_Checks

Incorrect:

//RESULT TABLE Missing_Checks.fil

Log name

Optional. The name value specifies an analytic log file name. If you do not specify name, the default log name is used: analytic_name.log.

Note

If you specify a log name, SET LOG TO log_name must appear in the script.

File name

The name value specifies a non-Analytics file name.

You must specify the appropriate file extension for the type of non-Analytics file being output.

Correct:

//RESULT FILE Missing_Checks.xlsx

Incorrect:

//RESULT FILE Missing_Checks

Wildcard characters

Use one or more wildcard characters in name to assist with matching a table, log, or file name in the script. Use a single asterisk ( * ) to substitute for zero or more consecutive characters.

Patterns created by mixing wildcard and literal characters allow you to match all items of a particular type (for example, *.xlsx ), or items where part of the name may change based on a variable definition in the script.

description

optional

Descriptive text about the result or other information. The description can be multiline, but it cannot skip lines.

The description appears in the analytic header only and is not visible to end users in client applications.

Examples

Basic examples

RESULT tag for an Analytics table:

//RESULT TABLE Missing_Checks

RESULT tag for an analytic log with the default name:

//RESULT LOG

RESULT tag for an analytic log with a specified name:

//RESULT LOG My_log_name
.
.
.
SET LOG TO My_log_name

RESULT tag for a specific Excel file:

//RESULT FILE Missing_Checks.xlsx

RESULT tag for all Excel files:

//RESULT FILE *.xlsx

Advanced examples

Table name with a month that varies

An output table name includes the month (invoices-jan, invoices-feb, and so on), so you specify invoices-* to ensure that the table is made available in the results regardless of the month suffix:

//RESULT TABLE invoices-*

Log name with a date that varies

A log file name includes a datestamp (prepare_invoice_table_31072019, and so on), so you specify prepare_invoice_table_* to ensure that the log file is made available in the results regardless of the datestamp:

//RESULT LOG prepare_invoice_table_*

File name with a month that varies

An output file name includes the month (invoices-jan.xlsx, invoices-feb.xlsx, and so on), so you specify invoices-*.xlsx to ensure that the file is made available in the results regardless of the month suffix:

//RESULT FILE invoices-*.xlsx

File name with a month and a format that vary

An output file name includes the month and is output in different formats (invoices-jan.xlsx, invoices-jan.del, and so on), so you specify invoices-*.* to ensure that the files are made available in the results regardless of the month suffix or file type:

//RESULT FILE invoices-*.*

Remarks

Uploads to the cloud-based Robots app

For Robots installations that use an on-premise Robots Agent, specifying RESULT LOG or RESULT FILE in an analytic script causes analytic log files or non-Analytics files to be uploaded to the cloud-based Robots app in HighBond. All information is encrypted in transit, and in the cloud-based Robots app.

For more information about logs, see How log files are output.

Specifying RESULT TABLE uploads the table layout only (field name, data type, field length). Result table data remains on your organization's network, within the Robots Agent directory.

How log files are output

How log files for analytic scripts are output depends on whether a script succeeded or failed, and on which environment the script is running in.

Analytic script Robots Agent AX Server Analysis App window

Succeeded

  • RESULT LOG specified

    log file uploaded to cloud-based Robots app

  • RESULT LOG not specified

    no log file

  • RESULT LOG specified

    log file output to AX Server (available in client applications)

  • RESULT LOG not specified

    no log file

  • RESULT LOG specified

    log file output to Results tab

  • RESULT LOG not specified

    no log file

Failed

  • RESULT LOG tag not considered
    • log file automatically output to Robots Agent base data folder

      (configuration setting = "false")

    • log file automatically uploaded to cloud-based Robots app

      (configuration setting = "true" (default))

    See configuration setting UploadLogsWhenFailed in Configuring a Robots Agent.

  • RESULT LOG tag not considered

    log file automatically output to AX Server (available in client applications)

  • RESULT LOG tag not considered

    log file automatically output to Results tab

Result file size limitation on AX Server

Result files are limited to a maximum of 2 GB for analytic scripts running on AX Server. If the file exceeds this size, results are not saved.

Result file storage and availability during script execution on AX Server

When you use the //RESULT FILE tag, the file that is created is available for download from AX Web Client and AX Client once your script completes. This file is stored in the AX database and is not available on the file system of AX Server when the script is not running.

During the execution of your script, the file is available temporarily on the file system of AX Server and you can work with it using external processes, such as those you invoke using the EXECUTE command. While your script is running, external processes can access the file from the analytic job subfolder.

Note

By default, analytic job subfolders are located inside ACL\Data\jobs. Once the script completes, the analytic job subfolder is removed and the file is stored in the database.