Input ECC Queue payload as a Data Source
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2018 10:27 PM
We are fetching information from external source using output ECC queue and input ECC Queue is having payload which we want to insert in Import-Set table. So, is there any mechanism in ServiceNow to make ECC Queue [input] as a ‘Data Source’ and feed the payload. Because we can see only option as file/LDAP/JDBC.
Or we need to use only REST API [of import set table] / GlideRecord API?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2018 10:42 PM
Hi Ankit,
There is no way for this. Once you receive the request in input ecc queue you can write a business rule for this.
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
02-26-2021 12:58 PM
Ankur,
I have a script which uses REST to update data on a remote server using executeAsync() via MID server.. My script is working fine but I am worried about 1000's of "input" entries in ECC queue sitting as 'ready'.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0727028 says about using :
sm.setEccCorrelator("rest.yahoo"); // unique identifier for this message, used by the custom sensor business rule for matching the ecc_queue input
Is there a documentation or example for this "unique identifier" business rule? Is there a OOB business rule ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2018 10:50 PM
Like Ankur said, you cannot use the ECC queue as a Data Source.
Take a look at the setEccCorrelator method in the scripted RESTMessageV2 API. It might be useful to you. It allows you to use REST with the ECC queue. You can process the response from the ECC queue to insert records into the Import Set Table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2018 11:26 PM
Hello,
You can use File , XML in data source.
From ECC queue payload can be stored in a file as xml format and attach to a data source (refer below link to create an attachment from string)
https://community.servicenow.com/community?id=community_question&sys_id=f47fbaa9db58dbc01dcaf3231f961940
Create a data source problematically attach a transform map , load data and run transform using sample code below which I wrote for similar requirement make necessary changes to fit your requirement.
var transformMapSysID="cf089606dbc123006b309006db9619ad";
var dataSource = new GlideRecord("sys_data_source");
dataSource.initialize();
dataSource.name=email.subject;
dataSource.file_retrieval_method="Attachment";
dataSource.import_set_table_label="computer_ci_import_set";
dataSource.import_set_table_name="u_computer_ci_import_set";
dataSource.type="File";
dataSource.format="CSV";
dataSource.csv_delimiter=",";
var dataSys=dataSource.insert();
//Atatch excel from email to data source
GlideSysAttachment.copy('sys_email',emailGr.sys_id,'sys_data_source',dataSys);
// Load data from excel to import set table
var loader = new GlideImportSetLoader();
var importSetRec = loader.getImportSetGr(dataSource);
var ranload = loader.loadImportSetTable(importSetRec, dataSource);
importSetRec.state = "loaded";
importSetRec.update();
//Run transform
var transformWorker = new GlideImportSetTransformerWorker(importSetRec.sys_id, transformMapSysID);
transformWorker.setBackground(true);
transformWorker.start();
Regards,
Sateesh Kumar Devadoss.