Define ServiceNow AI Lens behavior with Lens actions
As a Lens admin, you can create Lens actions in ServiceNow AI Lens to customize Lens behavior by providing default instructions, configuring context, and more.
- Trigger ServiceNow AI Lens from a desktop, ServiceNow instance, or Virtual Agent (from a mobile device or a portal)
- Auto-fills a form on the ServiceNow instance
- View the gathered insights in an editable preview
- Trigger flows, subflows, or actions after Lens execution
- Invoke AI agents
- Run ServiceNow AI Lens as a back-end service
Whenever ServiceNow AI Lens is launched from an instance, it checks if any active Lens action is available for the table. If available, it uses the logic defined in Lens action during execution. The Lens action can only be used by the users or groups who are assigned to the Lens Actions record.
Refer to the following examples to understand the different use cases of setting up the Lens actions.
Customize ServiceNow AI Lens behavior by creating a Lens action
Create a Lens action to define custom context, trigger options, and default instructions for the ServiceNow AI Lens execution.
Before you begin
Role required: lens_admin
About this task
Learn about the various trigger options for ServiceNow AI Lens.
| Goal | Trigger From | Trigger For |
|---|---|---|
| Auto-fill a form with a custom context and default instructions when triggered from the instance. When ServiceNow AI Lens is triggered from the instance in the context of the Lens action, the default instructions are always applied and specific form fields are extracted. To view the procedure to define default instructions, see Define default instructions for ServiceNow AI Lens. |
Instance | Form |
| Auto-fill a form with a custom context and default instructions when triggered from the ServiceNow AI Lens desktop app. You can trigger ServiceNow AI Lens from the desktop app directly in context of the Lens action instead of launching Lens from the instance. The default instructions are always applied and specific form fields are extracted. |
Desktop | Form |
| With the help of a client script or server script, run ServiceNow AI Lens as a back-end service. | Instance | Service |
| View the gathered insights in the preview window of ServiceNow AI Lens by providing custom context and perform post processing steps. | Desktop | Others |
When ServiceNow AI Lens is triggered from the instance or desktop to auto-fill a form, it uses an active Lens action associated with the target table.
For example, if a user selects Create with Lens from Incident table list, ServiceNow AI Lens checks for an active Lens action record for the Incident table where Trigger From is set to Instance and Trigger For is set to Form. If a matching action record exists, Lens executes in the context of that action.
The Lens action can only be used by the users or groups who are assigned to the Lens Actions record.
Procedure
Example: Scan documents to auto-fill the Insurance Request form
Enable customers to scan documents related to car accident on their desktop to auto-fill the Insurance Request form on the ServiceNow instance.
Before you begin
Role required: lens_admin
About this task
You can define in the Lens action that ServiceNow AI Lens must be triggered from the desktop to auto-fill the Insurance Request form. Lens action includes the fields that must be updated with the extracted data.
Procedure
Example: Extract structured data from vendor agreements
Enable compliance analysts to digitize and review several vendor agreements. Instead of manually entering details, they can launch ServiceNow AI Lens directly from the desktop, scan agreements, and adjust extracted values in the preview window before saving.
Before you begin
Role required: lens_admin
About this task
You can define in the Lens action that ServiceNow AI Lens must be triggered from the desktop to scan the documents saved on the user system. With the post processing option, you can edit the extracted information in the preview window before saving and trigger post processing to create related list records.
Procedure
Example: Auto-fill user records on a user table
Enable service agents to create user records by extracting specific information from identity documents using ServiceNow AI Lens, directly from the ServiceNow instance.
Before you begin
Role required: lens_admin
About this task
A service agent must onboard multiple users by scanning their official ID cards (for example, government-issued ID). Instead of manually entering each user's details, the agents can trigger ServiceNow AI Lens from the instance to automate data extraction and auto-fill specific fields defined in the Lens action record.
You can define in the Lens action that ServiceNow AI Lens must be triggered from the instance to create user records and provide default directions.