Dataset Extras
Import Logging
Inbound Datasets use ServiceNow Import Sets giving you the ability to view dataset imports as you would any other data import.
For detailed Activity Logs, navigate to the Transform page on a Dataset and enable the Import logging option.
Datasets with Import logging enabled will generate one Activity Log for each Import Set Row.
Dataset Cleanup
Dataset Requests are a record of when all Dataset imports and exports occurred. They are linked directly to Transactions that belong to a Bond which is exclusive to the Dataset. The records are automatically deleted when the corresponding Transaction is deleted.
The number of Transactions to keep during the daily cleanup can be managed using the Cleanup option which can be configured on each Dataset. This value specifies the number of transactions that should remain following the cleanup process. The default retention is 10 records.
Any Dataset Requests which are somehow orphaned, meaning they have no Dataset or no Transaction specified, will be removed based on the Orphan Record Cleanup Age x_snd_eb.orphan_record.cleanup.age
system property. The default orphan cleanup age is 7 days.
Export Tuning
When a Dataset export runs, the system will automatically export the records in small batches depending on its configuration.
Batch size options are:
Max size: set the maximum file size to export. There is an internal maximum size of 5MB.
Max rows: limit batches to a specific number of records.
Max time: prevent long running exports by setting a maximum export time.
The final export size is determined by whichever limit is reached first. If more records are available to be processed, additional Dataset Requests will be created until all records have been exported.
Create a Dataset Field Map
New Field Maps can be configured for handling specific types of data in new ways. We recommend using the "Dataset" prefix when creating your new field map so it is easy to identify.
Dataset specific Field Maps are slightly different to eBonding integration field maps. The main difference is that the Stage to Target script is executed as a ServiceNow Transform Map script. This means that certain objects are not available, including transaction
, bond
, and request
.
These Field Maps should reference the Import Set Row fields using the standard $stage
object. Field name conversion from the Import Set Row source
object to the Field Map $stage
object is handled automatically, i.e. "u_" prefixes are removed.
The target
object which represents the record being created or updated can be used normally.
The log
object is updated to reference ws_console
meaning all logs will be written to the Activity Log generated for each imported record. If required, logs can continue to be written to the Import Set Row using the source
object.
Disable Dataset Import
By default, Datasets are automatically configured for both import and export. If you require a one-way data export without import, you can prevent inbound messages from being processed.
From Integration Designer, navigate to the Dataset in your integration.
Find the Send message and click the clickthrough button to open it.
Change the Direction from Bidirectional to Outbound.
Click Save.
Multiple Tables
Datasets are designed to work with one table at a time. If you need to import/export more than one table, setup a Dataset for each table.
Sending Data from a Third Party
Externally generated files can be processed by a Dataset. Files should match the file type the Dataset expects, e.g. CSV or JSON, and be streamed to the Dataset import endpoint. The maximum file size will depend on your instance configuration.
POST
https://<instance>.service-now.com/api/x_snd_eb/unifi/<api_name>
Send a file to be processed by a Dataset.
Example: https://acme.service-now.com/api/x_snd_eb/unifi/incident/dataset?file_name=cmdb_ci.csv&reference=Sync%20Server
Query Parameters
file_name*
String
Name of the file
reference*
String
The name of the dataset
Headers
Content-Type*
String
text/csv OR application/json
x-snd-eb-message-name*
String
The name of the Send message, e.g. Send_<table>
Using IRE (Identification and Reconciliation Engine)
It is possible to add support for ServiceNow IRE to your Dataset imports. This will push data through the reconciliation engine rather than directly updating the target records from the Import Set.
Follow these steps to configure your Dataset for use with IRE.
Create a new Data Source.
Create a Field Map for setting up the import for IRE.
Create a Field Map to give the data to IRE.
Add header and footer fields to the Dataset.
Modify Field Maps being used by the Dataset.
Remember to Build the Message/Integration when you have finished configuring the Fields.
Publishing with Run As user
When publishing Datasets (or any scheduled script) to an update set or application, especially if submitting to the ServiceNow Store, you need to ensure the "Run as" field is emptied since the user will likely not exist on the target system.