- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 04:21 AM
Hi Team,
I've a requirement where i've created a decision table which contain multiple output result for single input value.
I want a flow to run via service catalogue ,so the requestor can update the values in Decision table and keep it updated.
What scripting API can i use, i'm not able to understand how the output values are stored and if i can pick and choose what i want to update .
kindly assist.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 01:49 AM
Hi Everyone ,
anyone faces similar requirements in future,
here is how i did it ,
var decisionTableGR = new GlideRecord('sys_decision');
decisionTableGR.addQuery('sys_id', decisionTableSysId);
decisionTableGR.query();
if (decisionTableGR.next()) {
var decisionAnswerGR = new GlideRecord('sys_decision_question');
decisionAnswerGR.addEncodedQuery('decision_table=table_SYS ID ^active=true'');
decisionAnswerGR.query();
while (decisionAnswerGR.next()) {
var resultElements = decisionAnswerGR.answer.toString();
var grDecisionResult = GlideRecord('sys_decision_multi_result');
grDecisionResult.get(resultElements);
grDecisionResult.result_elements.variableONTable = newVariableValue;
grDecisionResult.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 12:29 AM
@Ankur Bawiskar , my business requirement is that we create approval based on the category,
these owners and subowners for the category often change, earlier these values were hard coded, i've now updated these values in Decision table and i'm automating the updation of owner and subowners via the Service catalogue.
Regards,
Varun Sharma
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2025 12:38 AM
Sorry that's not the actual purpose why we use Decision tables.
Decision tables cannot be updated via script etc
They are to be configured from UI by admins or developers.
If there is change in requirement an admin can simply navigate to that decision table and update it and publish that.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2025 01:49 AM
Hi Everyone ,
anyone faces similar requirements in future,
here is how i did it ,
var decisionTableGR = new GlideRecord('sys_decision');
decisionTableGR.addQuery('sys_id', decisionTableSysId);
decisionTableGR.query();
if (decisionTableGR.next()) {
var decisionAnswerGR = new GlideRecord('sys_decision_question');
decisionAnswerGR.addEncodedQuery('decision_table=table_SYS ID ^active=true'');
decisionAnswerGR.query();
while (decisionAnswerGR.next()) {
var resultElements = decisionAnswerGR.answer.toString();
var grDecisionResult = GlideRecord('sys_decision_multi_result');
grDecisionResult.get(resultElements);
grDecisionResult.result_elements.variableONTable = newVariableValue;
grDecisionResult.update();
}