- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2023 08:50 AM
Hello,
We got a workflow (table = sc_req_item) with a notification activity in it.
From the script of this Notification activity, i need to Gliderecord to the approvals table to get 2 values from 2 fields.
My question is, how to use values from script to the message of the Notification ?
I tried below with the reqBy variable but nothing appear.
Result
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 11:04 AM - edited 06-16-2023 11:04 AM
Have you tried the following:
${workflow.scratchpad.positionTest}
I know you could create a new notification in the system and pass the scratchpad in the parm fields in the EventQueue to send the data within the email, but try the above first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-15-2023 02:39 PM
Hi, not sure if I have understood your requirement correctly, but based on this doc
Using variables in Notify workflow activities (servicenow.com)
I think you would need to update your script to create your new variables as scratchpad variables.
Using variables in a workflow (servicenow.com)
These should then be available to consume in your notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 09:33 AM
Hi Tony,
i tried to pass data from scratchpad but it seems im doing it wrong.
I am trying to pass data from Run script activity to Notification activity.
Run script :
var getAppFields = new GlideRecord("sysapproval_approver");
getAppFields.addEncodedQuery('state=approved^wf_activity.name=Approval facility managers^sysapproval.sys_id=' + current.sys_id);
getAppFields.query();
while (getAppFields.next()) {
var pos = getAppFields.u_sdm_position.getDisplayValue();
var prof = getAppFields.u_sdm_profile.getDisplayValue();
}
workflow.scratchpad.positionTest = pos;
workflow.scratchpad.profilTest = prof;
Notification Message :
Any advicehow to make it work ?
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2023 11:04 AM - edited 06-16-2023 11:04 AM
Have you tried the following:
${workflow.scratchpad.positionTest}
I know you could create a new notification in the system and pass the scratchpad in the parm fields in the EventQueue to send the data within the email, but try the above first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-19-2023 01:21 AM
It works now!
Thank you very much @Steven Parker .