Decision Table Not Executing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 12:02 AM
Hi all,
I am new to decision table and stuck here.
I have a decision table created. (attached the screenshot)
I was trying to call this via script, basically to get decisions passing the inputs. I tried writing script taking help from documentation but i got an error (screenshot below)
below is my script
Please help me where I am wrong or what exactly has to be done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2024 01:11 AM
Also if I remove 'result_elements' it returns null as an response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 01:43 AM
in your script line 6, change it to
var answer = response.result_elements.u_ans.toString();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2024 02:31 AM
Hi @Kapil_1409
You are calling getDecisions() method instead of getDecision(). Refer below code and modify your script accordingly and see if it works :
try{
var inputs={};
inputs['u_acrobat'] = true; // True/False
inputs['u_photoshop'] = true ; // True/False
var dt = new sn_dt.DecisionTableAPI();
var response = dt.getDecision('a6f476d793570210a73775dcebba10d3', inputs);
var result_elements = response.result_elements;
var u_ans = result_elements.u_ans.getValue(); // String
}
catch(e){
gs.log("Couldn't run this script Error: "+e)
}
Thanks and Regards
Amit Verma
Please mark this response as correct and helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-05-2025 10:25 PM
I'm getting a similar error, any solution please let me know.