GlideImportSetTransformerWorker alternative for Scoped App
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2019 03:40 AM
Hello,
I want to know if there is a Scoped App alternative to GlideImportSetTransformerWorker?
I need to run imports using an Asynch-import table and I can't find a good way to start the Transform Map without above.
Any help would be much appreciated!
With regards
Anton
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2019 07:16 AM
Hi Anton,
I believe you must be having Data source, Transform map and field map ready and you want to trigger the transform map via script.
Create a scheduled data import and select the data source you already have, set it active false since you will be triggering it via script
For this you can use below server side code: and this will work in scoped app
var schImp_GR = new GlideRecord('scheduled_import_set');
schImp_GR.addQuery('name','<nameYouGive>');
schImp_GR.query();
if(schImp_GR.next()){
gs.executeNow(schImp_GR);
}
Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-22-2019 03:07 AM
Hello,
The issue is that with REST I can get 200 results a time (a limit in the system we retreive from); currently the script creates records in an import table (no issues there) and they run transform for each line written.
I want to set the import table to Asynchronous and after the different scheduled schripts are done filling the table, start the Transform map.
This is possible in Global app without any issues, as GlideImportSetTransformerWorker works fine. Unfortunately it's blocked in Scoped Apps.
Your solution is to create a file, store it, and then run a normal scheduled import using the file?
Regards
Anton
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-03-2019 03:06 AM
Hi Anton,
Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2019 12:11 AM
Hello,
Please read my follow up comment before requesting closure of this.
As stated, I am collecting data through a script and the external system has a limit where I need the data collected in increments of 200.
Your solution would only work if I got all the data at once, or stored it in an intermediate location.
Unless I misinterpreted your suggestion?
As far as I can read from your code it activates the scheduled import, but says nothing about preventing import map from running synchronosly; I need the scheduled import to fetch all the data to the import table, and then trigger transform map.
But since I need to use a script to add each row in the import table, as the script needs to run in increments of 200 until there is nothing left (meaning the last run will not have 200 objects) it's not possible to get all the data at once without an asynch import table.
Regards
Anton