How to call Decision builder from Server script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2023 11:12 PM
Hello Experts,
Good day!! May I know how to call decision builder from Server script? I was able to do that from flow designer, wanted to check how to call decision builder from Fix script or server script?
tried the following syntax, yet output is not correct. Can anyone help me here?
var dt = new sn_dt.DecisionTableAPI();
var input = new Object();
input['xxx'] = '099143481bb315d880d1ffbb9b4bcbf0';
var response = dt.getDecisions('e36de89e87326d901af0ec260cbb3579', input);
var firstRecord = response[0];
firstRecord variable doesn't have sysId of the output reference record.
Thanks in advance..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-16-2023 11:59 PM
Hi @SRI10,
The way you are calling the decision builder is correct, you just need to add one more line to fetch the output
var firstRecord = response.result_elements.<output variable name>;
Please refer to example provided in the image below:
If my answer has helped with your question, please mark it as correct and helpful
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2023 10:14 PM
Hello Karan,
Good day!!
Here in the decision builder, I'm returning group record as output, how to find the `backend value of the group record that is being returned from Decision builder?
var response = dt.getDecision('26eea7a9dba07300efc65404ce961961', inputs);
var user = response.result_elements.u_user;
May I know what the data type of response is. Is that list type, and how to find the backed value of group that is being returned from Decision builder?
Thanks in advance...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-17-2023 10:46 PM - edited ‎05-17-2023 10:47 PM
@SRI10 - it's usually the output column name in lower case with prefix as u_, any spaces are replaced by _
ex. if the output column name is Approval Group, then the backend name would be u_approval_group
If my answer has helped with your question, please mark it as correct and helpful
Thanks!