---
sourceDocument: Australia Customer Service Management
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/pt-BR/customer-service-management

 Release :

    - australia

ft:locale :

    - pt-BR

ft:publication_title :

    - Australia Customer Service Management

ft:clusterId :

    - csm

bundleId :

    - csm

workflow :

    - Customer and Industry


---

# Configure AI Search contextual filter preprocessing for Recommended Actions

# Configure AI Search contextual filter preprocessing for Recommended Actions {#ariaid-title1}

* Versão de lançamento: Australia
* 
* Atualizado 12 de mar. de 2026
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 min. de leitura

Configures AI Search to preprocess contextual inputs from Recommended Actions so search results are dynamically filtered and boosted based on the current record context.

## Antes de Iniciar

Role required: admin

## Por Que e Quando Desempenhar Esta Tarefa

When recommendations are generated, Recommended Actions passes contextual information to AI Search using the Additional Context payload. After receiving this payload, AI Search performs preprocessing before executing the
search. Preprocessing is an internal preparation step that ensures contextual inputs are interpreted in a structured form, made available to AI Search dynamic filtering logic, and evaluated against search results during
execution.

At this stage, AI Search does not return results. Instead, it prepares the contextual data so it can be applied consistently during filtering and ranking. Once preprocessing is complete, the prepared contextual data is used
by AI Search dynamic filters. Preprocessing supports logic evaluated through the AisDynamicFilter extension point, including filter condition evaluation (preprocessing). This enables AI Search to determine whether a search
result is relevant to the current context record.

Preprocessing results in CI‑based filtering, meaning that search results that do not match the contextual configuration item (CI) information are filtered out, and only results relevant to the current record context are
included. In addition to filtering, preprocessing enables CI‑based boosting, which prioritizes results that are more relevant to the current context and ranks contextually aligned results higher in the search output.

## Procedimento

1. Enable dynamic filtering for a specific search source in a search Profile.
   1. Navigate to AllAI SearchSearch ExperienceSearch profiles.
   2. Select a search source of your choice from the Search Sources related list.
2. In the selected search source, select the Has Dynamic Filters check box and select Save.  
   Nota:  
   There may be multiple search profiles in your instance. Enable contextual filtering only for the search sources in a profile where you need this functionality. For more information on Search source form, see [Search Source form](https://www.servicenow.com/docs/bundle/zurich-platform-administration/page/administer/ai-search/reference/search-source-form-ais.html).
3. Create the AisDynamicFilter implementation for search sources.
   1. Navigate to AllSystem Extension PointsScripted Extension Points.
   2. Open the AisDynamicFilter extension point.
   3. Create an implementation for search sources by selecting the Create Implementation link.  
      Use the additionalContext stringified JSON with the following format in the implementation. It defines the contextual information passed to the AI Search API which is used in AI Search Dynamic filters to
      contextually filter out the search results.

          isApplicable: function(searchContextConfigId, profileId, tableName, additionalContext, preprocess) {
                  if (additionalContext != null && JSON.parse(additionalContext).source == 'recommended-actions' && tableName == JSON.parse(additionalContext).contextRecordTable && preprocess) {
                      return true;
                  }
                  return false;
              },
              getFilterCondition: function(searchContextConfigId, profileId, tableName, additionalContext) {
                  if (additionalContext != null && JSON.parse(additionalContext).source == 'recommended-actions' && tableName == JSON.parse(additionalContext).contextRecordTable) {
                      var pasedAdditionalContext = JSON.parse(additionalContext);
                      var gr = new GlideRecord(tableName);
                      gr.addEncodedQuery('sys_id!=' + pasedAdditionalContext.contextRecordId);
                      gr.query();
                      return gr;
                  }

              },
              shouldRemoveDocument: function(searchContextConfigId, profileId, recordClass, sysId, additionalContext) {
                 
              },

      The parameter in the preceding additionalContext are defined as:
      * `contextRecordId`: Sys ID of the current context record where recommendations are surfaced.
      * `contextRecordTable`: Table name of the current context record where recommendations are surfaced.
      * `contextualInputs`: Inputs to the context record.
      {#ra-configure-contextual-filtering__ul_fgn_nbm_m3c}
   {#ra-configure-contextual-filtering__substeps_fcm_q1m_m3c}

## Resultado

In the Search tab of the Recommended Actions context side panel, only the search results that match the exact context of the current record appear.

