Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As a Voice Experience Developer you can extend the scheme fields under the msg.analytics.attributes.<your_custom_property_name>

Code Block
var _ = global.get('lodash');
var  tv_series=  ['Bones', 'Psych', 'Big Bang Theory', 'Mad Men', 'Breaking Bad', 'Modern Family', 'Game of Thrones', 'Dexter'];

rndnum = Math.floor(Math.random() * 8);

node.warn(tv_series)
node.warn(rndnum)

msg.analytics.attributes = {
    'str': `this is a string`, 
    'const': 2,
    'bool': true,
    'mycontextData': {
        // 'name': `name_${_.sample(tv_series)}`,
        'series_name': tv_series[rndnum],
        'value': `value__${_.sample(tv_series)}`
    },
};
return msg;

for every agent, there will be a separate schema.

...