- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 07:45 PM
Can you please help me someone on below query.
I have a requirement to insert a row into the decision table via a scripting flow, where I have an input variable value and an output variable. The input variable references the schedule table, and the output variable references the group table.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 03:52 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-28-2025 10:27 PM
Hello @elanrajad ,
You can use the DecisionTable API to create new decisions, for example:
var decisionID = 'SYS_ID_OF_DECISION_TABLE';
var questions = [
{
condition: 'u_schedule=SYS_ID_OF_SCHEDULE_1',
answer:[
{
name: 'u_group',
value: 'SYS_ID_OF_GROUP_1'
}
],
active: true,
defaultAnswer: true,
order: 100
},
{
condition: 'u_schedule=SYS_ID_OF_SCHEDULE_2',
answer:[
{
name: 'u_group',
value: 'SYS_ID_OF_GROUP_2'
}
],
active: true,
defaultAnswer: false,
order: 150
}
];
var dt = new sn_dt.DecisionTableAPI();
var response = dt.createQuestions(decisionID, questions);
gs.info(JSON.stringify(response));
The above example assumes that your input is named "Schedule" and the output is named "Group", and that both have the "Reference" type.
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 02:02 AM - edited 05-29-2025 02:05 AM
Hi @Robert H Thanks for your response
when am trying via background script its giving below error how can we over come ?
@Ankur Bawiskar you have any suggestions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 02:43 AM
Hello @elanrajad ,
Looks like the Draft authoring feature is enabled for this Decision table.
You need to click Create Draft before running the script, or disable the feature.
Regards,
Robert
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-29-2025 03:38 AM
Hi @Robert H
I have tried where decision table is in draft mode and publish mode as well its not working for me
The below is the script am running from background script