{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":22175,"path":"integrate-applications/system-export-sets/t_ScheduleAnExport.md","title":"Schedule an export","bundle":null,"doc_type":null,"release":"australia","body":"\n# Schedule an export\n\nYou can schedule an export to regularly push data from an export set to a remote destination. By setting up a recurring, scheduled export you are able to regularly push data to an external location, such as for reporting or for preserving a snapshot of the data.\n\n## Before you begin\n\nRole required: export\\_set\\_scheduler or export\\_set\\_admin\n\n## About this task\n\nYou can configure scheduled export sets to export only new or changed records using delta exports.\n\n## Procedure\n\n1.  Navigate to **All** &gt; **System Export Sets** &gt; **Administration** &gt; **Scheduled Exports**.\n\n2.  Click **New**.\n\n3.  Fill in the following fields.\n\n<table id=\"table_ktt_k4y_lr\"><thead><tr><th>\n\nField\n\n</th><th>\n\nDescription\n\n</th></tr></thead><tbody><tr><td>\n\nName\n\n</td><td>\n\nEnter a descriptive name for this scheduled export.\n\n</td></tr><tr><td>\n\nExport set\n\n</td><td>\n\nSelect the export set to schedule.\n\n</td></tr><tr><td>\n\nRun as\n\n</td><td>\n\nSelect the user to run the scheduled export as. Ensure the user has any roles needed to view the data to export.\n\n</td></tr><tr><td>\n\nRun\n\n</td><td>\n\nSelect the frequency for scheduled export.\n\n</td></tr><tr><td>\n\nDay\n\n</td><td>\n\nSelect which day of the week or month to run this scheduled export on. This field appears when the **Run** field is set to **Weekly** or **Monthly**\n\n</td></tr><tr><td>\n\nRepeat interval\n\n</td><td>\n\nEnter the number of days and hours to wait before repeating this scheduled export. This field appears when the **Run** field is set to **Periodically**.\n\n</td></tr><tr><td>\n\nTime\n\n</td><td>\n\nEnter the time of day to run the scheduled export.\n\n</td></tr><tr><td colspan=\"2\">\n\nDelta Exports\n\n</td></tr><tr><td>\n\nEnable delta exports\n\n</td><td>\n\nSelect this check box to enable delta functionality for this scheduled export. When selected, only new or changed records are exported.\n\n</td></tr><tr><td>\n\nDelta on or after\n\n</td><td>\n\nSelect **Updated** to export all records that changed since the last export, including new records. Select **Created** to export only new records created after the last export.**Note:** If the export definition already includes a filter condition on the sys\\_updated\\_on or sys\\_created\\_on fields, enabling delta exports will prevent you from saving the scheduled data export record. An error appears at the top of the form in this event.\n\n</td></tr><tr><td>\n\nLast export scheduled run\n\n</td><td>\n\nLeave this field blank to export all records from the export definition. When using delta exports, this field is set automatically each time the scheduled export runs. Records updated or created after this date and time are included in the export delta, depending on the **Delta on or after** value.\n\n</td></tr><tr><td colspan=\"2\">\n\nScripts\n\n</td></tr><tr><td>\n\nConditional\n\n</td><td>\n\nSelect this check box to run the schedule only when a condition is met.\n\n</td></tr><tr><td>\n\nCondition\n\n</td><td>\n\nWrite the script to be used to evaluate whether the export should run. This field is visible if you select the **Conditional** check box.\n\n</td></tr><tr><td>\n\nExecute pre-export script\n\n</td><td>\n\nSelect this check box to run a script before the export begins.\n\n</td></tr><tr><td>\n\nPre script\n\n</td><td>\n\nWrite the script you want to run before the data is exported. This field is visible if you selected the **Execute pre-export script** check box.\n\n</td></tr><tr><td>\n\nExecute post-export script\n\n</td><td>\n\nSelect this check box to run a script after the export finishes.\n\n</td></tr><tr><td>\n\nPost script\n\n</td><td>\n\nWrite the script you want to run after the export finishes. This field is visible if you selected the **Execute post-export script** check box.\n\n</td></tr><tr><td>\n\nParallel export\n\n</td><td>\n\nSelect this check box to enable parallel exports. See [Parallel exports](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/system-export-sets/parallel-exports.md).\n\n</td></tr></tbody>\n</table>4.  Click **Submit**.\n\n\n## What to do next\n\nYou can click the **Execute Now** button to run the export immediately and confirm the data is exported as expected.\n\n## Scheduled export set delta exports\n\nDelta exports include only the records that changed since the last scheduled export.\n\nYou can use delta export for regular tables only, such as the task and problem tables.\n\n**Important:** You cannot use delta export for a database view table, which is a virtual table that joins physical tables.\n\nA database view does not include system fields such as sys\\_created on, sys\\_created by and sys\\_updated on. Because the system date fields are not included in the database view, you cannot use delta exports with database views since there is no way to know when the table was last updated.\n\n## Scheduled export set scripting options\n\nWhen scheduling an export set, you can access certain JavaScript objects.\n\nUse these objects in scheduled export set scripts, such as the **Pre-script** and **Post-script** fields.\n\n-   **cancel**\n\n    Set this object to true to stop the export action. Any child export sets are also cancelled if the parent is cancelled. This object is available only in the **Pre-script** field.\n\n    Example: Use the **Pre-script** field to evaluate the conditions of the export and determine whether to cancel the export process. To cancel the export process, use the following call:\n\n    ```\n    cancel = true;\n    ```\n\n-   **export\\_set**\n\n    Get the GlideRecord object for the new export set. This variable allows you to query the following columns from the sys\\_export\\_set table:\n\n    -   name\n    -   sys\\_id\n    -   state\n    -   table\\_name\n    This object is available in both the **Pre-script** and **Post-script** fields.\n\n    Example: If you want to use information from the export set, you can specify one of the properties of the export\\_set variable.\n\n    ```\n    var x = export_set.sys_id;\n    ```\n\n\n"}}