" /> Use transaction list object data in composer workflow ECMAScript - Genesys CTI User Forum

Author Topic: Use transaction list object data in composer workflow ECMAScript  (Read 2241 times)

Offline sutanu

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Advertisement
Function: _genesys.session.getListItemValue(Transaction_List, Section)  returns an OBJECT of key/value pairs: {Key1:value1, Key2:Value2, ..}

I am getting a string by using valueOf() function but not able to print in log from ECMAScript to check the string format.

If anyone has any idea how to store the each KVP info in a string array in ECMAScript.... Please help.


Thanks in advance.
« Last Edit: March 27, 2017, 07:02:31 PM by sutanu »

Offline mikehardie

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Use transaction list object data in composer workflow ECMAScript
« Reply #1 on: March 28, 2017, 04:33:52 PM »
The object you are seeing is a JSON object.
To log the object as text __Log( JSON.stringify( <object var> ))
If there is a kv pair with the key of MyKey you can access it by <object var>.MyKey


var obj =  _genesys.session.getListItemValue(Transaction_List, Section) ;
__Log( JSON.stringify( obj ));

var myVar = obj.MyKey;





Offline sutanu

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Use transaction list object data in composer workflow ECMAScript
« Reply #2 on: April 02, 2017, 08:37:34 AM »
Thanks a lot Mike :)