---
sourceDocument: Brazil ServiceNow AI Platform Administration
sourceDocumentLink: https://www.servicenow.com/docs/r/platform-administration

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Search Scripted Post-processors form

# Search Scripted Post-processors form {#ariaid-title1}

Release version: Brazil  
Updated October 20, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Search Scripted Post-processors form

The Search Scripted Post-processors form in ServiceNow allows you to create and manage scripted post-processors within AI Search application configurations.
These scripts enable you to modify search results dynamically after the initial query, enriching the search experience by transforming or customizing result data before it is presented to users.
Show full answer Show less  

## Key Features

* **Activation Control:** Enable or disable individual scripted post-processors.
* **Name and Application Scope:** Define a unique name and application context automatically scoped for the script.
* **Type Selection:** Choose the record type the script will process --- either Genius Result (AI-generated answers) or Search Result (standard search records).
* **Post-processing Script:** Write server-side JavaScript functions that receive each search result record as a parameter, allowing you to manipulate fields and values dynamically. For example, transforming date fields into human-friendly formats.
* **API Methods Overview:** The form UI provides guidance on available API methods for scripted post-processors to help with script development.

## Practical Usage

This feature is particularly useful for tailoring search results to your organization's needs, such as formatting dates, filtering results, or adding custom metadata. The example provided demonstrates converting the `sysupdatedon` date field of knowledge base articles into relative, human-readable time strings like "Just Now" or "2 days ago."

## How to Access and Manage Scripts

You can view and reuse existing search scripted post-processor scripts by accessing the `syssearchscriptedprocessor` table in list view:

* Navigate to **All** in the application navigator.
* Enter `syssearchscriptedprocessor.list` in the filter.
* Press Enter to open the list of existing scripted post-processors.

## Benefits for ServiceNow Customers

By leveraging the Search Scripted Post-processors form, customers can:

* Enhance AI Search results with customized logic to improve relevancy and presentation.
* Implement post-query data transformations directly within the search pipeline without modifying source data.
* Maintain flexible and manageable search result customization aligned with evolving business requirements.  
The Search Scripted Post-processors form enables you to create a search scripted post-processor in the search application configuration for an AI Search application.
For details on creating or editing search scripted post-processors, see [Using search scripted post-processors in AI Search application configurations](https://www.servicenow.com/docs/jbewhHAM_yui4aq~VTsyUg#script-post-process-ais "Use scripted post-processors to modify search result records for display in a search application.").  
{#search-script-postprocess-form-ais__table_jwr_5vb_5nb__entry__2}

| Field | Description |
|-|-|
| Active | Option to activate the search script post-processor. |
| Name | Name for the search script post-processor. |
| Application | Application scope for the search script post-processor. This field is automatically set. |
| Type | Type of record the search script post-processor operates on. Valid values: * Genius Result: Script operates on a Genius Result answer record. * Search Result: Script operates on a search result record. {#search-script-postprocess-form-ais__ul_h5s_kyb_5nb} |
| Post processing script | Server-side script function that takes a record object as its parameter. When the search scripted post-processor is linked to a search application configuration, search results reflect changes made to the record object in this script function. As an example, this post-processing script function operates on search results from the kb_knowledge table, transforming sys_updated_on date field values into a human-readable format: function process(record) { var transformableTables = ['kb_knowledge']; var transformableDateFields = ['sys_updated_on']; var table = record.getTable(); // Terminate early if possible, to avoid unnecessary overhead if (transformableTables.indexOf(table) === -1) return; function transformToHumanFriendlyDate(rawDate) { // Time gaps in ms var MINUTE_GAP = 60000; var HOUR_GAP = 3600000; var DAY_GAP = 86400000; var WEEK_GAP = 604800000; var MONTH_GAP = 2592000000; var YEAR_GAP = 31536000000; var gap = new Date().getTime() - rawDate; if (gap < MINUTE_GAP) { return gs.getMessage('Just Now'); } else if (gap > MINUTE_GAP && gap < 2 * MINUTE_GAP) { return gs.getMessage('1 minute ago'); } else if (gap < HOUR_GAP) { return gs.getMessage('{0} minutes ago', '' + Math.floor(gap / MINUTE_GAP)); } else if (gap > HOUR_GAP && gap < 2 * HOUR_GAP) { return gs.getMessage('1 hour ago'); } else if (gap < DAY_GAP) { return gs.getMessage('{0} hours ago', '' + Math.floor(gap / HOUR_GAP)); } else if (gap > DAY_GAP && gap < 2 * DAY_GAP) { return gs.getMessage('1 day ago'); } else if (gap < WEEK_GAP) { return gs.getMessage('{0} days ago', '' + Math.floor(gap / DAY_GAP)); } else if (gap > WEEK_GAP && gap < 2 * WEEK_GAP) { return gs.getMessage('1 week ago'); } else if (gap < MONTH_GAP) { return gs.getMessage('{0} weeks ago', '' + Math.floor(gap / WEEK_GAP)); } else if (gap > MONTH_GAP && gap < 2 * MONTH_GAP) { return gs.getMessage('1 month ago'); } else if (gap < YEAR_GAP) { return gs.getMessage('{0} months ago', '' + Math.floor(gap / MONTH_GAP)); } else if (gap > YEAR_GAP && gap < 2 * YEAR_GAP) { return gs.getMessage('1 year ago'); } else { return gs.getMessage('{0} years ago', '' + Math.floor(gap / YEAR_GAP)); } } for (var i = 0; i < transformableDateFields.length; i++) { var fieldName = transformableDateFields[i]; var updatedDateField = record.getField(fieldName); if (updatedDateField !== null) { var updatedDateRaw = updatedDateField.getValue(); if (updatedDateRaw != null) { var humanFriendlyDate = transformToHumanFriendlyDate(updatedDateRaw); updatedDateField.setDisplayValue(humanFriendlyDate); } } } } Note: The UI displays an overview of API methods usable in the post-processing script function. You can copy code from an existing post-processor script to use as a starting point for your own script function. To access existing post-processor scripts, open the Search Scripted Post-processors \[sys_search_scripted_processor\] table in list view by following these steps: 1. Select All. 2. In the navigation filter, enter <kbd class="ph userinput">sys_search_scripted_processor.list</kbd>. 3. Press Enter. {#search-script-postprocess-form-ais__ol_tcp_pjk_fcc} |
[Table 1. Search Scripted Post-processors form]

{#search-script-postprocess-form-ais__table_jwr_5vb_5nb}

