createQuestions not working for decision table

ShAn21
Tera Guru

Hi Folks,

I am trying to work with DecisionAPI's to insert results dynamically to the Decision table and using  the dt.createQuestions(decisionID, questions) API.

Below is my code snipped. Do you guys see anything that might be off here. The status logs is coming as 'undefined'.

var decisionID = '41afb75247832110251f8657536d43a4'; // Table sysiD
var questions = [
{
condition: 'u_service=ghi^EQ',
answer:[
{
name: 'u_skip_result',
value: true
},
{
name: 'u_links',
value: 'e319a2952f6991104d9c2ca62799b6c5'
}
],
active: true,
defaultAnswer: true,
order: 300
},
{
condition: 'u_service=jkl^EQ',
answer:[
{
name: 'u_skip_result',
value: false
}
],
active: true,
defaultAnswer: false,
order: 150
}
];

var dt = new sn_dt.DecisionTableAPI();
var response = dt.createQuestions(decisionID, questions);
gs.info(JSON.stringify(response));
gs.info('Status - ' + response.status);
//gs.info('First decision sys id - ' + response.results[0].record.getValue('sys_id'));
//gs.info('Second decision sys id - ' + response.results[1].record.getValue('sys_id'));

 

 

Let me know if you have faced similar issue,

 

Thanks

1 REPLY 1

Cesar Augusto A
Tera Contributor

I had the same problem and solved it by converting the condition to string.