The CreatorCon Call for Content is officially open! Get started here.

Decision Table API, where input is a reference to a Glide Record

Jamsta1912
Tera Guru

Hi all,

 

I'm using the DecisionTableAPI to get a decision from a table, basing my script on this from the docs: https://developer.servicenow.com/dev.do#!/reference/api/utah/server/sn_dt-namespace/DecisionTableAPI 

var dt = new sn_dt.DecisionTableAPI();
var inputs = new Object();
inputs['u_age'] = 25;
var response = dt.getDecision('26eea7a9dba07300efc65404ce961961', inputs);
var user = response.result_elements.u_user;

This is working fine for decision tables where the inputs are strings, but I'm struggling to get it to work where the input is a GlideRecord (type = reference). Should the value I pass in be the sys_id of the GlideRecord or the whole GlideRecord? Truth be told, I'm having no success either way 😞

 

3 REPLIES 3

Ankur Bawiskar
Tera Patron
Tera Patron

@Jamsta1912 

are you sure your decision table input variable is of correct type i.e. reference and referring to correct table?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Hi Ankur,

Thanks for taking a look at this. Yes, here is a screenshot of the input. 'Commercial Model' is a custom table:

 

Jamsta1912_0-1702661292314.png

This is the only input for the decision table.

Sushanti24
Tera Contributor

@Jamsta1912 : Did you find a solution to this issue, I am also stuck in the same exact issue. If you could share the solution, it will be really helpful.