How to change import set row mode to asynchronous ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 03:23 AM
Hi All,
When record is inserted in staging table through web service the import set mode is set to synchronous and transform map runs and record is created in the target table. Is it possible to set the mode to asynchronous , how to do this?
Regards,
Snehal K

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2018 03:45 AM
Hi!
Hope this may help you in your task.
The following is a list of steps to import data from an Outbound REST call in combination with a MID Server using a Scheduled Job and hold it with in an Import Set table using Asynchronous Import Set and Transform Map. Then schedule a job to perform the transform.
Create a table that extends Import Set Row
-
- Give it a name
- Create a new application menu or Place module under Existing application menu or none
- Uncheck the auto create user role if not desired
- Create necessary columns
- Create Transform Map
- Enter name of above table with .list appended in the text filter box
- <table_name>.list
- Click on Transform Maps
- Click New
- Give it a name
- Assign the target table
- Enter name of above table with .list appended in the text filter box
- Create an import set
- Enter sys_import_set.do in text filter box
- Set mode to Asynchronous
- Keep State at Loading
- Set table to import set table created in step one
- Give description if needed
- Create Outbound REST call
- When creating the call method be sure to populate the MID Server field with desired MID Server
- Create a Scheduled Job (not a Scheduled Import) to populate the import set
- Click New
- Choose to run a script
- Set the desired times when to execute script
- Grab the scripted code from the REST call by clicking the Preview Script Usage
- Create a script that will use the REST call script usage to populate the table created in step one. You can also do any manipulation in here before populating or use the script sections in the transform map.
- Example:
try {
var r = new sn_ws.RESTMessageV2('name_of_your_outbound_rest_message', 'get');
r.setStringParameter('a_parameter', 'parameter_value');
var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
}
catch(ex) {
var message = ex.getMessage();
}
var results = responseBody.split(','); //This depends on what's in your response
var restGR = new GlideRecord('u_table_from_step_one');//Important
restGR.initialize();
restGR.u_assigned_to = result[0]; //this would depend on your response
restGR.u_assignment_group = result[1]; //this would depend on your response
restGR.u_short_description = result[2]; //this would depend on your response
restGR.u_description = result[3]; //this would depend on your response
restGR.sys_import_set = 'sys_id of the import set created in step 3'; //Important
restGR.insert();
- Example:
- Modify the Scheduled Job named "Asynchronous Import Set Transformer" to meet your requirements to run all Asynchronous import sets or just the one specific Rest Call import set if you haven't done your specific modifications in step 5 or in the Transform Map
Thanks
Raj Patel
(DXSherpa)
Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact