Is there a way to query the ECC queue payload and get a value from it?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-22-2015 11:54 PM
Hi All,
For one of my automation item I need to query some table from a SAP system and evaluate some value of a field. Now I got a sample script from concerned team for this. But after querying it will echo the value. If so can we get that value from ECC queue payload based on the variable inside it ?
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2017 04:55 AM
Hi Ajai,
Good Day
Please find the below script to retrieve the value of the payload.
Var eccRecord = new GlideREcord('ecc_queue');
eccRecord.addQuery('sys_created_on','ONToday@javascript:gs.daysAgoStart(0)@javascript:gs.daysAgoEnd(0)');
eccRecord.addQuery('queue','input');
eccRecord.addQuery('topic','SAP');
eccRecord.query();
while(eccRecord.addQuery()){
var payload = eccRecord.payLoad;
gs.print('The Payload is'+payload);
}
Thanks,
Priyanka R
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-19-2019 03:52 AM
Do it this way .
var grQue=new GlideRecord('ecc_queue');
grQue.addQuery('sys_id','443660881b51c4d00d5221be6e4bcb15');
grQue.query();
if(grQue.next())
{
var text =grQue.payload+'';
var xmlhelp = new XMLHelper(text);
var x = xmlhelp.toObject();
gs.print("tag is: " + x.result.stdout);
}