Scheduled Import Not working when triggering from BR
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-24-2025 11:50 PM
Hello Team,
I'm facing issue while scheduled import triggering from BR in Global Application.
BR Table : sc_req_item
BR Condition: After Insert
Please find the Business Rule Script Below
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 12:44 AM
Hello @Robert H ,
I tried this as well but its not working.
As import set state is in Loading only.
Thanks
Shrikant
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2025 01:02 AM - edited 04-25-2025 01:02 AM
Hello @shrikant Kahar1 ,
The "Loading" state means the system is still processing the file. Depending on the amount of data in the file it can take some time until it's done and changes to "Loaded". Have you opened the Import Set and checked if there any entries in the "Import Set Rows"?
Another approach would be: instead of copying the attachment to the Data Source, you can simply tell the Data Source to load the file from the original record, like this:
var sourceTable = 'sc_req_item';
var sourceId = current.sys_id;
var dataSourceId = '430167151bbca61064e5ed73b24bcb27';
var scheduledJobId = 'f12f0225c3f86a1016f64bcd2b013174';
var grDataSource = new GlideRecord('sys_data_source');
if (!grDataSource.get(dataSourceId)) return;
var grScheduledJob = new GlideRecord('scheduled_import_set');
if (!grScheduledJob.get(scheduledJobId)) return;
grDataSource.setValue('connection_url', 'attachment://' + sourceTable + ':' + sourceId + '/');
grDataSource.update();
SncTriggerSynchronizer.executeNow(grScheduledJob);
Regards,
Robert