To Bulk update fields on the catalog task table fields
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 01:29 AM
Hello All,
We have bulk update request to update the fields Customer name and Customer location which is created on the sc_task table.
We already have customer name and customer location available on the catalog form which has stored the data and reflects in variables of these catalog task, but there was no mapping to the table fields earlier.
We have now created the mapping from flow and thus the fields gets updates from the flow itself, but the issues lies with a whole chunk of old data which is in the system and needs to be updated.
Please help the best approach to do this without any impact, please note we have around 4000 such old tickets were we have map the variables values to the fields on the form as updated above.
Suggestions on the same is highly appreciable.
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 01:45 AM
Hi @Kaustubh k you can use background script to update, if your going with background script you may need to use setLimit() method to limit the record update, may be 500 records per update or you can go with schedule job which runs at the background.
sample script:
var task = new GlideRecord('sc_task');
task.addNullQuery('Customer name');// put correct fieldname need only empty fields
task.addNullQuery('Customer location');// put correct fieldname need only empty fields
task.setLimit(1); // test for 1 record
task.orderBy('sys_created_on'); // sort by created field
task.query();
while(task.next())
{
task.fieldname = task.variables.variableName;
task.update();
}
Harish