logo

NJP

How to export records from multiple tables into one XML file, or add them to an update set [SwissNow]

Import · Sep 30, 2018 · article

Details described here: https://community.servicenow.com/community?id=community_article&sys_id=72d65bd0db34a7048e7c2926ca961...

2. Open options

Right click on SwissNow icon and select Optons.

image

3. In "Configuration packages" section click "New"

image

4. Define relationships of your configuration tables

In this example, we will be exporting data from sys_user table and all corresponding sys_user_has_role records.

  1. Provide configuration package name (to describe the content being exported), e.g. User with roles
  2. Provide main table exact name. In out case, the main table is sys_user
  3. Define parent-child relationships of your configuration records
  4. * Enter parent table name, e.g. sys_user
    • Enter child table name, e.g. sys_user_has_role
    • Enter a relationship qualification, e.g. user=${sys_id} (The qualification is applied to the child table - sys_user_has_role. In the qualification you should use fields from the parent table - sys_user - to define relationship between records. Use $[field} syntax to refer to parent record fields. In this example, "user" is a field from child table and "${sys_id}" will be replaced with the sys_id of a record from parent table - sys_user).
    • Click "Add". (You can add as many parent-child relationships as you want. You can also add self-relationship, e.g. cmn_location --> cmn_location)
    • Click "Save"

image

5. Open a record to export with all its relationships

image

You can also open a list of records - just remember to apply a filter to the list of records.

6. Click on SwissNow icon and switch to "Compare / Copy" tab

image

7. Click on the name of your newly defined configuration package

image

8. Wait for the records to be downloaded into memory

image

9. Download XML file or add all your records to the current update set

  1. To download all configuration records in single XML file, click Generate file
  2. To add all configuration records to the current update set, click Add all to UpdateSet (note that sys_user table exceptionally cannot be added to an update set due to security constraints)

Labels:

image

View original source

https://www.servicenow.com/community/developer-articles/how-to-export-records-from-multiple-tables-into-one-xml-file-or/ta-p/2330287