logo

NJP

Export sets - Learn Integrations on the Now Platform

Import · Dec 01, 2021 · video

[Music] in this video we'll cover export sets export sets give us a way to automatically export a set of records to a remote system via a mid server for more information on mid servers check out the mid server video earlier in this series the basic components of an export set are the export set itself which defines the overall information of how and what is being exported the export definition record is referenced by the export set to define the table fields and filter for the records being exported the export target tells the export set which mid server to use and where to store the files on the target mid server and finally the schedule that tells the system when to run the export set let's walk through the process to export our list of active upgrade tasks as an xml file every night at 1 am we'll start by navigating to system export sets create export set to do this we'll need either the admin or export set admin role the system displays a record producer to help build the export set and export definition we'll start by giving this a name and we can either choose yes here to pick an existing export definition to define the table's fields in filter or choose no to pick the table we want to export we'll choose no and pick a table next we can either choose yes if we have an existing export target or no to create a new one let's choose no to create a new export target with the new mid server we just set up for exporting records and finally we'll provide a directory path where to store the files be aware that the file path is relative to the mid server's install directory we'll see where this actually is after our export is complete let's click submit and see what we get we're taken to the export set record where we can refine the details let's change the file format from csv to xml then save let's click through the export definition to see the details of what records and fields are being exported from our table okay let's edit this list of fields to include all the fields on this record this is xml after all and finally we'll set the filter to active is true when we save we also see that there's a preview button and when we click it we see what records will be exported so we can validate our export definition all that's left is to create the schedule so we'll navigate to system export sets scheduled exports and create a new record to do this we'll either need the admin export set scheduler or export set admin role as usual we'll give a name choose our export set and who this schedule should run as this is important because the security of the user you choose may impact which records are exported or not next we'll tell the scheduler when to run this export for our case we'll choose daily at 1am however other choices are available including a way to run immediately after another export schedule is complete using a parent field to run exports consecutively may be useful for related or dependent tables for example we may want to export all of our users then groups then group members instead of trying to guess a time when users and groups will be exported before exporting the group membership table we could choose after parent runs in the run field and then choose the scheduled export that takes care of the groups in the delta export section we can choose to get all the records or just those updated or created after the last export this can significantly decrease the system load and the time required to export however we may want to use the option on the export set to append a time stamp to each file because without it our delta export will overwrite an earlier file of the same name leaving this field blank exports all records the first time and then gets filled in when the schedule is complete in the script section we have the ability to run this schedule conditionally perhaps only mondays wednesdays and fridays if the conditional script evaluates to true then the schedule runs two other scripting options are available to run the script before the export begins and after the export completes this could be useful for anything from preparing the data to sending notifications now that our export schedule is defined let's save it and using the execute now button we can test it we'll then navigate to system export sets export history to open our record and review the status we can also see these records as a related list on the export set it looks like this one is complete so let's go check out our output file on our mid server after navigating to the mid server's agent directory we'll continue to the export slash upgrade directory where we told our export target record to store the files and there are the records we exported one final tip we touched on in the previous video we can use the list header menu to create an export set export definition and then choose the target in a single click this is a bit quicker than using the record producer or creating the export records manually we should still inspect the export set and export definition records manually to adjust things like names formats and filters export sets allow you to export data from a servicenow table to another system via a mid server and they are very flexible easy to configure and maintain

View original source

https://www.youtube.com/watch?v=XV_C5OrHzrk