From Bright Pattern Documentation

Revision as of 20:10, 2 April 2026 by Laura.donovan (talk | contribs) (Updated via BpClonePage extension. Source page: draft:AgentDesktop-client-side-javascript-api-specification/onSearchRecords)

< Previous | Next >
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

onSearchRecords

Communicator Widget sends this event when an interaction's scenario has a screen pop block with the "SHOW_QUERY_RESULTS" option.

Request

Syntax

on('ON_SEARCH_RECORDS', handler: OnSearchRecords): void


type OnSearchRecords = (searchText: string, interactionId?: string, inNewTab?: boolean) => void

Parameters

Parameter Parameter Values Data Type Optional/Required Description
searchText string Required Text to search across CRM records
interactionId string Optional ID of the interaction which is associated with the action
inNewTab boolean Optional Specifies the intention to display search result in a new tab

Example Request

    adApi.on("ON_SEARCH_RECORDS", function (searchText, interactionId, inNewTab) {

        if (inNewTab) {

            searchCrmRecordsInNewWindow(searchText);

        } else {

            searchCrmRecords(searchText);

        }

    });

Return Value

(None)

< Previous | Next >