Decision Table API, where input is a reference to a Glide Record
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 02:26 AM
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 😞
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2023 03:46 AM
are you sure your decision table input variable is of correct type i.e. reference and referring to correct table?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2023 09:29 AM
Hi Ankur,
Thanks for taking a look at this. Yes, here is a screenshot of the input. 'Commercial Model' is a custom table:
This is the only input for the decision table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2024 07:09 AM
@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.