Sort Import Set before Transform
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-14-2020 11:29 AM
I am importing a large amount of licenses that need to go to the alm_license table. The table references the PO number, the date ordered and the quantity. However the problem is that the quantity is not sorted well. This means a PO could have negative numbers as the first value. The goal would sort the quantity in a descending order.
If I was going to script this I would do:
gr.orderBy('u_po_number');
gr.orderBy('u_date_ordered');
gr.orderByDesc('u_quantity');
The issue is I am not sure how to do this with a Transform Map. I would assume an onStart possibly could do this but does anyone know of a way?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-15-2020 01:49 AM
Hello,
You won't be able to apply sorting when using an import set.
It even goes the other way, ServiceNow guaranties that the lines will be imported in same order as they are provided.
So if you need sorting, you have to ask the entity that generates the files to generate it as sorted (or apply a shell script for instance).
Note: If you have a large amount of data, you migth one day be interested to use Concurrent Import Set. This feature basically import the lines in parallel and saves you lot of time. However in this case, you would lose sorting.
If interested: https://docs.servicenow.com/bundle/paris-platform-administration/page/administer/import-sets/concept...
Regards,