<style> .release-box { height: 30px; width: 100px; padding-top: 8px; text-align: center; border-radius: 5px; font-weight: bold; background-color: #828995; border-color: #FCE28A;} .release-box:hover { cursor: hand; cursor: pointer; opacity: .9; } </style> <meta name="robots" content="noindex"> <div class="release-box"> <a href="https://docs.perspectium.com/display/Lithium" style="text-decoration: none; color: #FFFFFF; display: block;"> Lithium </a> </div> |
Once you are familiar with the basics of ServiceNow table maps, including the difference between inbound and outbound table maps, how to create a table map, and how to add a table map to bulk shares, there are optional features you can configure based on your needs.
By default, data replicated from existing tables will automatically create the same schema at the replicated database. The targeted database schema of replication needs to be flexible and customized in certain situations, such as:
Customizing your target database schema is done by using table maps in your share.
Here's how:
Instructions:
To share the table map output, you need to crate a share and select the table map from step 1 in the Table map field. The generated payload can be subscribed by the DataSync Agent and the schema created dynamically.
In this example, the common_incident table map will result in the following table schema, if consumed by the DataSync Agent for MySQL.
mysql> describe common_incident; +---------------------+--------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +---------------------+--------------+------+-----+---------+-------+ | state | mediumtext | YES | | NULL | | | short_description | varchar(160) | YES | | NULL | | | description | mediumtext | YES | | NULL | | | priority | mediumtext | YES | | NULL | | | attachments | mediumtext | YES | | NULL | | | category | mediumtext | YES | | NULL | | | correlation_id | varchar(100) | YES | | NULL | | | number | varchar(40) | YES | | NULL | | | correlation_display | varchar(100) | YES | | NULL | | | caller_id | mediumtext | YES | | NULL | | | caller_email | varchar(100) | YES | | NULL | | | caller_full_name | mediumtext | YES | | NULL | | | comments | mediumtext | YES | | NULL | | | sys_id | varchar(224) | NO | PRI | | | | work_notes | mediumtext | YES | | NULL | | +---------------------+--------------+------+-----+---------+-------+ 15 rows in set (0.00 sec) |
The sys_id field is created as GUID (PRI key) and contains number values to be used for lookup during updates/deletes. This is consistent with replicating database views. |
Table maps can be configured to use scripts to serialize the record yourself. Within the script, you can set the variable answer to be the value you want the record to be serialized and returned as.
This is an advance configuration. Contact Perspectium Support for more information.
The following variables are available to use:
Variable | Description |
---|---|
current | This represents the record that is being shared |
gr_tablemap | This represents the outbound table map itself. For example if you want to access the table map's name, you can use gr_tablemap.u_name |
Instructions:
|
This feature allows you to map fields in the outbound record based on values from the ServiceNow record to be shared.
Prerequisites:
Instructions:
Using scripts, you an enhance or create new columns of data in your table map's field mapping. Here's how:
Prerequisites:
Instructions:
There are various ways you can use scripting in your field mappings. Here is an example:
To set an overall value for your field mapping, use the following:
|
For other ways to utilize scripting in your field mappings, contact Perspectium Support.