IMPORT GRCRESULTS command
Creates an Analytics table by importing a HighBond Results table or interpretation.
Syntax
IMPORT GRCRESULTS TO table import_filename PASSWORD num FROM Results_resource_path <FIELD name AS display_name <...n>>
Parameters
Name | Description | |||||||
---|---|---|---|---|---|---|---|---|
TO table |
The name of the Analytics table to import the data into. Note Table names are limited to 64 alphanumeric characters. The name can include the underscore character ( _ ), but no other special characters, or any spaces. The name cannot start with a number. |
|||||||
import_filename |
The name of the Analytics data file to create. Specify import_filename as a quoted string with a .FIL file extension. For example, "Invoices.FIL". By default, the data file (.FIL) is saved to the folder containing the Analytics project. Use either an absolute or relative file path to save the data file to a different, existing folder:
|
|||||||
PASSWORD num |
The password definition to use. You do not use PASSWORD num to prompt for, or specify, an actual password. The password definition refers to a password previously supplied or set using the PASSWORD command, the SET PASSWORD command, or the PASSWORD analytic tag. num is the number of the password definition. For example, if two passwords have been previously supplied or set in a script, or when scheduling an analytic, PASSWORD 2 specifies that password #2 is used. For more information about supplying or setting passwords, see: Note PASSWORD may or may not be required, depending on the environment in which the script runs:
|
|||||||
FROM Results_resource_path |
The path to the data you are importing. The form of the path varies depending on the data you are importing. For details about the form of the path, see Results path. Note The form of the Results path is supplied by an API, and is subject to change. The easiest and most reliable way to acquire the correct and current syntax for the path is to perform a manual import of the target data, and copy the path from the command log. |
|||||||
FIELD name AS display_name <...n> optional |
Individual fields in the source data to import. Specify the name. If you omit FIELD, all fields are imported. Namename must exactly match the physical field name in the Results table, including matching the case. To view the physical field name, do one of the following:
Note The Results physical field name is not the display name used for column headers in the Table View. Also see Field name considerations when importing and exporting Results data. Display namedisplay_name (alternate column title) is the display name for the field in the view in the new Analytics table. You must specify a display name for each FIELD name. Specify display_name as a quoted string. Use a semi-colon (;) between words if you want a line break in the column title. Unlike some other IMPORT commands in Analytics, you cannot specify a blank display_name as a way of using the FIELD name as the display name. |
Examples
Importing specified fields from a table in Results
You import specified fields from a table in Results to an Analytics table named T and E exceptions:
IMPORT GRCRESULTS TO T_and_E_exceptions "C:\Secondary Analysis\T_and_E_exceptions.fil" PASSWORD 1 FROM "results/api/orgs/11594/control_tests/185699/exceptions" FIELD "metadata.status" AS "Status" FIELD "EmpNo" AS "Employee Number" FIELD "DATE" AS "Date" FIELD "CARDNUM" AS "Card Number" FIELD "CODES" AS "MC Codes" FIELD "AMOUNT" AS "Amount" FIELD "DESCRIPTION" AS "Description"
Importing all fields from a table in Results
You import all fields from a table in Results to an Analytics table named T and E exceptions:
IMPORT GRCRESULTS TO T_and_E_exceptions "C:\Secondary Analysis\T_and_E_exceptions.fil" PASSWORD 1 FROM "results/api/orgs/11594/control_tests/185699/exceptions"
Importing data from an interpretation in Results
You import an interpretation in Results to an Analytics table named T and E exceptions filtered:
IMPORT GRCRESULTS TO T_and_E_exceptions_filtered "C:\Secondary Analysis\T_and_E_exceptions_filtered.fil" FROM "results/api/orgs/11594/control_tests/185699/interpretations/22699/exceptions"
Remarks
Note
For more information about how this command works, see the Analytics Help.
Preserving sort order and filters
When you import data from Results, any data customization, such as sorting or filter, is retained or ignored in the resulting Analytics table depending on how you import the data:
- import a table data customization is ignored. All the data in the table is imported, with the exception of any fields you choose to omit.
- import an interpretation data customization is retained
Results path
Note
The form of the Results path is supplied by an API, and is subject to change. The easiest and most reliable way to acquire the correct and current syntax for the path is to perform a manual import of the target data, and copy the path from the command log.
The Results path in the FROM parameter takes the following general form:
FROM "results <-region code>/api/orgs/<org ID>/control_tests/<control test ID>/exceptions
For example: FROM "results/api/orgs/11594/control_tests/4356/exceptions"
The org ID is displayed in the browser address bar when you log in to Launchpad. The control test ID, and the interpretation ID, are displayed in the address bar when you are viewing those tables in Results.
The table below provides all the variations of the Results path.
To import: | Use this form of Results path: |
---|---|
Control test (table) data | FROM "results/api/orgs/11594/control_tests/4356/exceptions" |
Control test (table) audit trail | FROM "results/api/orgs/11594/control_tests/4356/audit_trail" |
Control test (table) comments | FROM "results/api/orgs/11594/control_tests/4356/comments" |
Interpretation | FROM "results/api/orgs/11594/control_tests/4356/interpretations/1192/exceptions" |
Data from a HighBond region other than the default region (us) |
|
System-generated information columns
When you import data from Results, you have the option of also importing one or more of the system-generated information columns listed below.
The system-generated columns are either:
- part of Results tables, and contain processing information related to individual records
- additional information – collection name, table name, or record ID number
You must specify the field names of the system-generated columns exactly as they appear below. The default display names apply when you import from Results through the Analytics user interface. You are free to change the display names if you are scripting the import process.
Field name |
Default display name |
---|---|
metadata.priority |
Priority |
metadata.status |
Status |
metadata.publish_date |
Published |
metadata.publisher |
Publisher Name |
metadata.assignee |
Assignee |
metadata.group | Group |
metadata.updated_at | Updated |
metadata.closed_at | Closed |
extras.collection | Collection |
extras.results_table | Results Table |
extras.record_id | Record ID |
Field name considerations when importing and exporting Results data
If you are round-tripping data between Results and Analytics, you need to ensure that all field names in the Results table meet the more stringent Analytics field name requirements. If you do not, you risk misaligning your Analytics and Results data.
For example, any special characters in Results field names are automatically converted to underscores when they are imported into Analytics, which means the field names no longer match the original names in Results. If you then export the Analytics data back to the original table in Results, fields are no longer correctly matched.
To avoid this problem with data that you intend to round-trip, make sure that before you upload the data to Results from CSV or Excel files it meets these Analytics field name requirements:
- no special characters or spaces
- does not start with a number
- contains only alphanumeric characters, or the underscore character ( _ )
Creating a password definition and specifying a password value
PASSWORD command
If you use the PASSWORD command to create the numbered password definition for connecting to HighBond, no password value is specified, so a password prompt is displayed when the script attempts to connect.
For more information, see PASSWORD command.
SET PASSWORD command
If you use the SET PASSWORD command to create the numbered password definition for connecting to HighBond, a password value is specified, so no password prompt is displayed, which is appropriate for scripts designed to run unattended.
For more information, see SET PASSWORD command.
HighBond access token
Regardless of which method you use to create the password definition, the required password value is a HighBond access token:
- PASSWORD method – Users can acquire an access token by selecting HighBond. An access token is returned, which users can copy and paste into the password prompt. , and then signing in to
- SET PASSWORD method – To insert an access token into the SET PASSWORD command syntax in an Analytics script, right-click in the Script Editor, select , and sign in to HighBond. An access token is inserted into the script at the cursor position.
Caution
The returned access token matches the account used to sign in to HighBond. As a scriptwriter, using your own access token may not be appropriate if you are writing a script to be used by other people.
Import debug capability
A simple debug capability exists for imports from HighBond.
The imported data is temporarily stored in a JSON intermediary file in the folder containing the target Analytics project. In any folder containing an Analytics project you can create a text file that causes the JSON file to be retained, instead of being deleting after the data is imported into Analytics.
- JSON file is present If the import from HighBond is failing, but the JSON file is present on your computer, you know that the problem is on the Analytics side, not on the HighBond side.
- JSON file is not present If the import from HighBond is failing, and the JSON file is not present on your computer, you know that the problem is on the HighBond side.
This information can help with troubleshooting.
Configure retention of the JSON intermediary file
In the folder containing the target Analytics project, create an empty text file with exactly this name: _grc_import_debug.txt
When you import from either Results or Projects in HighBond, the JSON intermediary file is retained with the name results.json. The file is overwritten with each subsequent import from HighBond.
Importing large tables
Tables that have a large number of fields may not successfully import using a single IMPORT GRCRESULTS command. If you need to work with a single table containing a large number of fields outside of Results, use one of the following approaches:
- Split the table use two or more IMPORT GRCRESULTS commands to import a subset of fields and then join the resulting tables in Analytics using the JOIN command
- Export the table to file use the export to CSV format and then import the resulting file into Analytics using the IMPORT DELIMITED command