{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":22221,"path":"integrate-applications/system-import-sets/r_DataImportScriptingOptions.md","title":"Scheduled data import scripting options","bundle":null,"doc_type":null,"release":"australia","body":"\n# Scheduled data import scripting options\n\nMultiple JavaScript objects are available in the Scheduled Data Import **Pre script** and **Post script** fields.\n\n<table id=\"table_DataImportScriptingOptions\"><thead><tr><th>\n\nObject\n\n</th><th>\n\nDescription\n\n</th><th>\n\nExample\n\n</th></tr></thead><tbody><tr><td>\n\ncancel\n\n</td><td>\n\nSet this object to true to stop the import action.\n\n</td><td>\n\nUse the **Pre script** field to evaluate the conditions of the import and determine whether to cancel the import process. To cancel the import process, use the following call:```\ncancel = true;\n```\n\n</td></tr><tr><td>\n\nimport\\_set\n\n</td><td>\n\nGet the GlideRecord object for the new import set. This variable allows you to query the following columns from the sys\\_import\\_set table:-   number\n-   sys\\_id\n-   state\n-   table\\_name\n\n</td><td>\n\nIf you want to use information from the import set, you can specify one of the properties of the import\\_set variable.```\nvar x = import_set.number;\n```\n\n</td></tr><tr><td>\n\ndata\\_source\n\n</td><td>\n\nGlideRecord of the data source to be used for the scheduled import.\n\n</td><td>\n\nTypically, you define the data source with the Scheduled Data Import record. If you want to access this data source or modify the data source in certain conditions, you can use the following.```\ndata_source.import_set_table_name = 'new_set_from_scheduler';\ndata_source.update();\n```\n\n</td></tr></tbody>\n</table>**Parent Topic:**[Schedule a data import](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/integrate-applications/system-import-sets/t_ScheduleADataImport.md)\n\n"}}