The CreatorCon Call for Content is officially open! Get started here.

Triggering Smart Assessment from Flow without using code snippet

Sameer K Pandey
ServiceNow Employee
ServiceNow Employee

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:

  1. 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
  2.  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.

 

Screenshot 2025-08-21 at 9.11.57 AM.png

 

Hope this is helpful.

 

By mistake this was setup as a question. This is not a question. New article with the same content is now available at https://www.servicenow.com/community/grc-articles/triggering-smart-assessment-from-flow-without-usin...

6 REPLIES 6

Laveena-Agarwal
Kilo Sage

Great Article, Insightful✨

Mark Manders
Mega Patron

You are a ServiceNow employee and your complaint is that the Docs aren't clear enough. Why not update the docs?


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Sameer K Pandey
ServiceNow Employee
ServiceNow Employee

Hello @Mark Manders Valid point. Feedback already provided for the documentation update. Article is not to post complaint. It is to help teams to look at alternative approach using events and flow with minimal code.

Rafael Cardoso
Tera Guru
Tera Guru

Great post, Sameer! You should consider turning this from a question format into a full article ðŸ˜Š

Raf


Helpful post? Don’t forget to bookmark it, give it kudos, or mark it as the answer to help the community grow!