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-fill 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
- Auto-map the column headers of an Excel sheet with the columns of a ServiceNow table, and then insert the Excel sheet data into the ServiceNow table.
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 or roles that 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.
Vorbereitungen
Role required: lens_admin
Warum und wann dieser Vorgang ausgeführt wird
Learn about the various Lens 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 |
| Auto-map the column headers of an Excel sheet with the columns of a specified table, and then insert the Excel sheet data into the table. To view the procedure to auto-map the column headers of an Excel sheet with the columns of a table, and insert Excel data into the table, see Auto-map Excel sheet column headers with table columns. |
Desktop | Excel Mapping |
| 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.
Prozedur
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.
Vorbereitungen
Role required: lens_admin
Warum und wann dieser Vorgang ausgeführt wird
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.
Prozedur
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.
Vorbereitungen
Role required: lens_admin
Warum und wann dieser Vorgang ausgeführt wird
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.
Prozedur
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.
Vorbereitungen
Role required: lens_admin
Warum und wann dieser Vorgang ausgeführt wird
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.
Prozedur
Auto-map Excel sheet column headers with ServiceNow table columns
Use ServiceNow AI Lens to map the column headers of an Excel sheet that you specify with ServiceNow® table columns and then insert the Excel sheet data into the table.
Vorbereitungen
Role required: lens_user
| Field | Option you must select |
|---|---|
| Trigger From | Desktop |
| Trigger For | Excel Mapping |
| Table | Name of the table with which the Lens action will auto-map the Excel sheet column headers. |
| Request context | Supported Fields |
| Fields | Columns of the table |