
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2023 09:53 AM
I am trying to trigger an email notification from flow designer that contains all of the variables in a requested item. I was able to get the notification to populate the variables using the following script and using the sc_task table, but the workflow throws an error "Notification requires table sc_task, record is of type sc_req_item". If I change the table to sc_req_item, it does not pull the variables into the notification. Can somebody help?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2023 10:44 AM
@sarahjantz : This will work, please use the below script and make sure the notification is configured on [sc_req_item] table.
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
var set = new GlideappVariablePoolQuestionSet();
set.setRequestID(current.sys_id); //changed
set.load();
var vs = set.getFlatQuestions();
for (var i = 0; i < vs.size(); i++) {
if (vs.get(i).getDisplayValue() != '' && +vs.get(i).getLabel() != '') {
template.space("\n");
template.print("\n" + vs.get(i).getLabel() + "::" + vs.get(i).getDisplayValue() + "\n");
}
}
})(current, template, email, email_action, event);
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2023 10:09 AM - edited ‎12-29-2023 10:20 AM
@sarahjantz : Looking into your screenshots, notification was configured on "sc_task" table and the the input record you are supplying in the flow to notification is an RITM. Please change the trigger record to the task instead of RITM.
Note : Both the table in the notification and the record you are supplying as input should be of same class. Based on your requirement on the notification (to be sent on RITM or catalog task) change the table in the notification or supply the right record in the flow as described
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2023 10:23 AM
It does not give me an option to change to a catalog task record. Additionally, if I change the table on the notification to sc_task, it does not allow me to select the notification in the Notification field because the table field (which is read only) is set to sc_req_item.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2023 10:31 AM
@sarahjantz : Assuming that a task is being created in the flow, please refer to the below screenshot.
The notification list is based on the table; it shows only the notifications from the selected table. In the above case, notification should be configured on the sc_task table.
Option 2: If you want to send at RITM level, notification should be configured on sc_req_item table.
Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-29-2023 10:34 AM
I do believe it should be a RITM notification because the notification isn't related to a task, it is related to the RITM and the RITM variables, but utilizing the sc_requested_item table doesn't populate the variables of the RITM the way that I need it to. I need to create a notification to a group of users that tells them what is being requested.