Update the column mapping script
On this page
Update the column mapping script
To transfer the custom column data to the Configuration Management Database (CMDB), update the column mapping script to add the corresponding entry to the importSetColumnsVsStagingColumnsMap object.
Before you begin
Role required: ot_excel_import_user
About this task
The importSetColumnsVsStagingColumnsMap object in the SGOTAssetImportExcelConstants script controls which columns from the SG OT Excel Stagings (sg_ot_excel_staging) table are included when you trigger the CMDB import process. If you add a custom column to the staging table, you must add a corresponding entry to the importSetColumnsVsStagingColumnsMap object. Otherwise, the custom column is ignored during import. For more information about triggering the CMDB import process, see Trigger a CMDB import for valid staging records.
Each entry in importSetColumnsVsStagingColumnsMap object is a key-value pair with the following format:
"<import set column name>": "<staging table column name>"
The key is the field name that appears in the JSON payload sent to the CMDB import (sn_otsm_sgc_sg_ot_excel_import) set. The value is the name of the corresponding column on the SG OT Excel Stagings table.
When you create a key and value, they’re typically identical. For example, a custom staging column named u_my_custom_field maps to itself. Only use a different name if you need the import set field name to differ from the staging table column name.
Procedure
-
Navigate to All > Industrial Workspace Admin > Import OT Devices - Script Includes.
-
Select the SGOTAssetImportExcelConstants record.
-
In the importSetColumnsVsStagingColumnsMap object, add a line in the following format:
"ETL Column Name": "Staging Table Column Name"For example:
"u_my_custom_field": "u_my_custom_field" -
Before your new entry, add a comma at the end of the line so that the object remains valid JavaScript.
-
Select Update.
What to do next
Configure the Robust Transform Engine (RTE) mapping for the Extract Transform Load (ETL). For more information, see Configure the RTE mapping for ETL.
Parent Topic:Add a custom column to the staging table
Keep exploring.
Find another answer, or bring this documentation into your own tools.