Automation on Decision table record insertion

elanrajad
Tera Contributor

Can you please help me someone on below query.

I have a requirement to insert a row into the decision table via a scripting flow, where I have an input variable value and an output variable. The input variable references the schedule table, and the output variable references the group table.

 

1 ACCEPTED SOLUTION

Hello @elanrajad ,

 

Have you tried unchecking the "Enable draft authoring" box?

 

Regards,

Robert

View solution in original post

13 REPLIES 13

Hello @elanrajad ,

 

Have you tried unchecking the "Enable draft authoring" box?

 

Regards,

Robert

Thanks @Robert H 

By unchecking its working fine 

is it possible to update/delete existing decision row records ?

Hello @elanrajad ,

 

Thanks for the update. Glad to hear that the solution is working.

 

Yes, you can update and delete the decision rows (a.k.a. questions) through the API as well, please review the updateQuestion() and deleteQuestion() methods in the documentation where you can also find code examples.

 

Regards,

Robert

Hi @Robert H  Thanks for your help

 for update question record i have used below logic but getting response as failure.

same way for delete also not working i followed the service documentation still not able to dlete/update

can you please help here any config/code changes am missing ?

 

var decisionId = '226c6cf98331221009799d60ceaad316';
var questions = {
   condition: 'u_schedule=f86b71e3672322004792adab9485ef19^EQ',
   answer:[
     
      {
         name: 'u_schedule',
         value: '82b9458b0ad337022123a9b06c8156de',
      }
   ],
   active: true,
   order: 100
};

var dt = new sn_dt.DecisionTableAPI();
var response = dt.updateQuestion(decisionId, questions);
gs.info('Status - ' + response.status);

 

Hello @elanrajad ,

 

As mentioned in the documentation the first parameter for the updateQuestion/deleteQuestion methods is the sys_id of the decision row you want to update/delete. It looks like you passed the sys_id of your decision table, which is only applicable for the createQuestions method.

 

Regards,

Robert