About This Session
Thanks for the pointer. It is a servicenow talk I'm giving so I renamed title "1 Query = n+1 Stakeholder-tailored Email" to stay with the one-to-many language SN heads are familiar with.
The successful experience I've had is using a scheduled job to trigger an event firing -- that event firing triggers a script action which queries the task table for records relevant to the business context [New unassigned RITMs generated by Cat Item XYZ, etc]. This is the "one query".
Then, the array of returned sys_ids prints to one of the parameter fields [parm1 or parm2] of the sysevent record that was inserted when aforementioned event fired.
A sysevent_email_action is fired by a Flow Designer Flow triggered by the same aforementioned event. The Flow has a realistic 'wait' node [to ensure the above action is completed] before the Flow then checks aforementioend sysevent for real values in parm1 or parm2 and then fires a sysevent_email_action which features a mail script in the html body -- if the sysevent parm1//parm2 check fails, the flow returns to the 'Wait' step and tries again.
The sysevent_email_action html body mail script references the parameter field of the inserted sysevent record and after aggregating the number of unique stakeholders across the array [e.g. the 'Requested For' sys_user field featured on every RITM] there is a 1:1 of email sent to each unique stakeholder related to the returned task record array -- the mailscript builds an html body and maps field contents from only the task records with the given stakeholder-addressee of the email to the built html table on the email.
There is also proven functionality also having the mail script build html buttons with embedded mailTo links for stakeholders to action for individual table rows ['true' button and a 'false' button, 'email this person' and 'email this group' buttons, etc.] to send back to SN as well as cc'ing specific individuals or groups in the email back to SN, as well as button(s) in the general email body outside of the html table for the same action to be sent taken on all contents featured in the email.
My presentation will start with a demonstration of this working POC, followed by a description of what the steps of the solution are doing as we build another POC together over the course of the rest of the presentation, concluding with us sending the stakeholder-tailored emails as the final result.
I'll provide a pdf flow chart for the attendees to reference if they wish to reference it as they build their own versions of this in their instance.