- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 08-21-2025 03:43 AM
Original article was placed as a question in the GRC forum. Thanks @Rafael Cardoso for your suggestion.
Dear All,
Docs doesn't elaborate much on how to use code snippet for Smart Assessment and at times customers find it confusing. For one of my customer, we explored using Events and using Flows to trigger Smart Assessment based on the Events. Scenario was to allow users to request Smart Assessments in Audit Application using UI Action.
For background on how to use events for Flows, refer to following articles first:
- https://www.servicenow.com/community/developer-forum/not-able-to-find-table-in-flow-designer/m-p/139... to use glide.ui.permitted_tables and adding sysevent
- https://www.servicenow.com/community/workflow-automation-articles/trigger-a-flow-based-on-an-event-e... by @Uncle Rob
Approach taken:
a. Setup an event in the registry. In this case, it was sn_audit_advanced.
b. Fire the event from the UI Action (with parm1 and parm2 as current.sys_id and current User)
gs.eventQueue('sn_audit_advanced.trigger_assessment.flo', current,current.sys_id, gs.getUserName());
c. Last step was where above listed articles/posts helped. Step the flow with trigger as Created on table sysevent with name as "sn_audit_advanced.trigger_assessment.flo". In the flow post the trigger step, use Look up record actions to first look up the current record and the user. Then use the Trigger Smart Assessment OOTB action and pass the values from Data Pill at the right places in the action.
Sample flow image. I did not added checks to see if the records exist post look up records, even though it is good practice (because it is assumption that those exist because the values are passed through UI Action with current contexts and in my case it is just a mock up). But I do advise to do these checks.
Hope this is helpful.
- 429 Views