IMPORT GRCRESULTS command
Concept Information
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: The required password value is a HighBond access token. For more information, see Creating a password definition and specifying a password value. 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
For more information about how this command works, see Import HighBond Results data.
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.
Acquire a HighBond access token
Regardless of which method you use to create the password definition, the required password value is a HighBond access token, which users can generate in Launchpad.
Caution
The generated access token matches the account used to sign in to Launchpad. As a scriptwriter, specifying your own access token in a script may not be appropriate if the script will be used by other people.
- Do one of the following:
- From the Analytics main menu, select Tools > HighBond Access Token.
- In the Script Editor, right-click and select Insert > HighBond Token.
The Manage API tokens page opens in your browser. You may be required to first sign in to Launchpad.
- Do one of the following:
- Use an existing token In the Token column, click the partially masked token that you want to use and enter your HighBond account password. The unmasked token is displayed.
Tip
Use an existing token unless you have a reason for creating a new one. If the existing token does not work, create a new one.
Using an existing token cuts down on the number of tokens you need to manage.
- Create a new token Click Create token > Analytics and enter your HighBond account password.
A new Analytics token is created.
Note
If you are a Launchpad System Admin, you also have the option of creating an API token. You should reserve API tokens for their intended purpose, which is programmatic access to the HighBond platform.
- Use an existing token In the Token column, click the partially masked token that you want to use and enter your HighBond account password. The unmasked token is displayed.
- Click Copy to copy the token.
Tip
Do not close the dialog box containing the token until you have successfully pasted the token.
- In Analytics, do one of the following:
- paste the token into the password prompt
- paste the token at the appropriate point in the SET PASSWORD command syntax in a script
- In Launchpad, close the dialog box containing the token.
If you created a new token, a partially masked version of the token is added to the top of your list of tokens.
For more information, see Creating and managing access tokens.
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