How to Decision tables in Workflow run script?

Community Alums
Not applicable

We have a requirement for calling decision table using Decision Table API in workflow via runscript.

Please let me know if you have any pointers or references.

 

Regards,

Bharath Doppalapudi

M:+91 9637470111.

6 REPLIES 6

Harsh Vardhan
Giga Patron

you can use table api here and then you can use Decision table 

 

sample code which you will use in run script activity. 

 

var request = new sn_ws.RESTMessageV2();
request.setEndpoint('https://dev34768.service-now.com/api/now/table/dmn_decision?sysparm_limit=10');
request.setHttpMethod('GET');

//Eg. UserName="admin", Password="admin" for this code sample.
var user = 'admin';
var password = 'admin';

request.setBasicAuth(user,password);
request.setRequestHeader("Accept","application/json");

var response = request.execute();
gs.log(response.getBody());

 

https://developer.servicenow.com/app.do#!/document/content/app_store_doc_outbound_rest_jakarta_t_Scr...

Community Alums
Not applicable

We want to use decision table to send an approval for KB Reveiwer, so in workflow to trigger that approval i want to call decision table....above code is something related to Rest message..it wont fit my requirement

Preethi22
Tera Contributor

Hi Harsh,

 

Requirement- We need to have additional approval to be configured for Knowledge Management workflow. This approval will be of Content reviewer which is being decided on the basis of the decision inputs:

Knowledge Base and Category.

We need to use the "DecisionTableAPI" to get the decision so that we can use it in activity approval under workflow.

Can you please give your inputs on the same?

 

 

you can calculate the final decision based on input but how will you set the user in approval ?  do you have any other variable which will set the user in answer variable ?

 

kindly have a look on below doc link, 

 

https://developer.servicenow.com/dev.do#!/reference/api/newyork/server/sn_dt-namespace/DecisionTable...