Extend the Cloudaware ServiceNow App with a Custom Table
This guide explains how to import a new Cloudaware table into ServiceNow. The process includes defining the table structure, creating the table, adding columns, mapping fields, and configuring import settings.
- Audience: ServiceNow administrators, ITSM/CMDB administrators, and Cloudaware administrators
- Outcome: A custom Cloudaware table is available in ServiceNow and included in the Cloudaware CMDB import workflow
Prerequisites
Before you begin, install and configure the Cloudaware CMDB application. To install the application from the ServiceNow Store, follow Installation from ServiceNow Store.
High-level Setup Flow
To extend the Cloudaware ServiceNow app with a custom table:
- Install the Cloudaware CMDB application.
- Prepare the Cloudaware data and create a table in ServiceNow.
- Add table columns and configure metadata import.
- Enable the Cloudaware CI data import flow.
Select Data for Import
Identify the Cloudaware dataset that must be imported into ServiceNow. Coordinate with your dedicated Technical Account Manager to determine the relevant tables and fields.
In this guide, the Azure Virtual Machine table is used as an example; however, the workflow applies to any Cloudaware table.
Create a Table in ServiceNow
-
In ServiceNow, navigate to System Definition → Tables.
-
Create a table record.
-
Set the table attributes. For example:
Field Value Label Azure Virtual Machine Name x_ca_cmdb_azure_virtual_machineExtends table Configuration Item ( cmdb_ci)Extending the
cmdb_citable ensures full usage of native Configuration Item (CI) capabilities within ServiceNow. -
Click Submit.
-
Provide Cloudaware with the table label and name.
Add Columns to the Table
Columns can be added manually or populated using a custom script provided by Cloudaware. For the base application tables and import controls, see Imported Tables.
Add Columns Manually
- In ServiceNow, navigate to System Definition → Tables.
- Select the table you created, for example, Azure Virtual Machine (
x_ca_cmdb_azure_virtual_machine). - Click New.
The following fields are mandatory:
| Label | Name | Type |
|---|---|---|
| Disappearance Time | x_ca_cmdb_ca10_disappearancetime_c | glide_date_time |
| Ca Uuid | x_ca_cmdb_ca10_cauuid_c | string |
| Last Imported At | last_imported_at | glide_date_time |
| Outdated | outdated | boolean |
Add Columns Using a Script
-
In ServiceNow, navigate to System Definition → Scripts - Background.
-
Apply the custom script provided by Cloudaware.
Custom script example
The custom script provided by Cloudaware contains the required fields for the selected table. For this guide, the script is prepared for the
Azure Virtual Machinetable.// === Configuration ===var tableName = 'x_ca_cmdb_azure_virtual_machine';// === Columns ===var fields = [{ label: 'Power State', name: 'x_ca_cmdb_ca10_powerstate_c', type: 'string' },{ label: 'Name', name: 'name', type: 'string' },{ label: 'Location Name', name: 'x_ca_cmdb_ca10_locationname_c', type: 'string' },{ label: 'Ram Gb', name: 'x_ca_cmdb_ca10_ramgb_c', type: 'decimal' },{ label: 'V Cpu', name: 'x_ca_cmdb_ca10_vcpu_c', type: 'decimal' },{ label: 'Role Size Name', name: 'x_ca_cmdb_ca10_rolesizename_c', type: 'string' },{ label: 'Id', name: 'x_ca_cmdb_ca10_id_c', type: 'string' },{ label: 'Os Type', name: 'x_ca_cmdb_ca10_ostype_c', type: 'string' },{ label: 'Vm Id', name: 'x_ca_cmdb_ca10_vmid_c', type: 'string' },{ label: 'Time Created', name: 'x_ca_cmdb_ca10_timecreated_c', type: 'glide_date_time' },{ label: 'Disappearance Time', name: 'x_ca_cmdb_ca10_disappearancetime_c', type: 'glide_date_time' },{ label: 'Ca Uuid', name: 'x_ca_cmdb_ca10_cauuid_c', type: 'string' },{ label: 'Last Imported At', name: 'last_imported_at', type: 'glide_date_time' },{ label: 'Outdated', name: 'outdated', type: 'boolean' }];fields.forEach(function(field) {var gr = new GlideRecord('sys_dictionary');gr.addQuery('name', tableName);gr.addQuery('element', field.name);gr.query();if (gr.next()) {gs.info('Field already exists: ' + field.name);} else {var f = new GlideRecord('sys_dictionary');f.initialize();f.name = tableName;f.element = field.name;f.column_label = field.label;f.internal_type = field.type;f.mandatory = false;f.active = true;f.insert();gs.info('Created: ' + field.label + ' (' + field.name + ')');}});gs.info('All fields were created: ' + tableName);
Contact Cloudaware support at support@cloudaware.com to request a script for your use case.
Update the Cloudaware Import Fields Mapping Table
Add records to the Cloudaware Import Fields Mapping table (x_ca_cmdb_import_fields_mapping).
-
In ServiceNow, navigate to System Import Sets → Load Data.
-
Add the file generated by Cloudaware.
-
Complete the import.
Cloudaware Import Fields Mapping (CA10__CaAzureVirtualMachine__c)
CI class field name SObject field name SObject name CI class table x_ca_cmdb_ca10_powerstate_cCA10__powerState__cCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machinenameNameCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machinex_ca_cmdb_ca10_locationname_cCA10__locationName__cCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machinex_ca_cmdb_ca10_ramgb_cCA10__ramGb__cCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machinex_ca_cmdb_ca10_vcpu_cCA10__vCpu__cCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machinex_ca_cmdb_ca10_rolesizename_cCA10__roleSizeName__cCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machinex_ca_cmdb_ca10_id_cCA10__id__cCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machinex_ca_cmdb_ca10_ostype_cCA10__osType__cCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machinex_ca_cmdb_ca10_vmid_cCA10__vmId__cCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machinex_ca_cmdb_ca10_timecreated_cCA10__timeCreated__cCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machinex_ca_cmdb_ca10_disappearancetime_cCA10__disappearanceTime__cCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machinex_ca_cmdb_ca10_cauuid_cCA10__caUuid__cCA10__CaAzureVirtualMachine__cx_ca_cmdb_azure_virtual_machine
Update the Cloudaware Import Settings Table
Add records to the Cloudaware Import Settings table (x_ca_cmdb_ci_class_import_settings).
-
In ServiceNow, navigate to System Import Sets → Load Data.
-
Add the file generated by Cloudaware.
-
Complete the import.
Update Cloudaware Import Settings (CA10__CaAzureVirtualMachine__c)
Active CI Class Label CI Class Table SObject Name TRUEAzure Virtual Machine x_ca_cmdb_azure_virtual_machineCA10__CaAzureVirtualMachine__c
Update the CI Class Import Table
Add records to the CI Class Import table (x_ca_cmdb_ci_class_import).
-
In ServiceNow, navigate to System Import Sets → Load Data.
-
Add the file generated by Cloudaware.
-
Complete the import.
Update CI Class Import (CA10__CaAzureVirtualMachine__c)
Cloudaware SObject Name Disappearance Time Field Name ServiceNow CI Class Label ServiceNow CI Class Table Custom Where Clause CA10__CaAzureVirtualMachine__cCA10__disappearanceTime__cAzure Virtual Machine x_ca_cmdb_azure_virtual_machineWHERE 1=1
Enable the Import All CI Data from Cloudaware Flow
- In ServiceNow, navigate to Process Automation → Workflow Studio.
- Open Flows.
- Select the Import All CI Data from Cloudaware flow.
- In Trigger, click the schedule section.
- Select Scheduled → Daily and set the run time.
- Click Done.
The recommended import frequency is once per day.
Configure Flow Variables
In Actions, click Set Flow Variables and configure the following values:
| Variable | Value |
|---|---|
| Connection Alias | Select the Connections & Credentials alias configured during Cloudaware CMDB app setup, for example, Google JWT. |
| Cloudaware Import Settings Table | Leave the auto-populated system table value. |
| Cloudaware Import Fields Mapping Table | Leave the auto-populated system table value. |
| Project Id | Enter the Import Project Id provided by Cloudaware. |
| Dataset Id | Enter the Import Dataset Id provided by Cloudaware. |
Click Done, then save and activate the workflow. For the standard import flow configuration, see the Workflow Studio steps in Installation from ServiceNow Store or Manual Installation.