From Bright Pattern Documentation

Revision as of 00:59, 3 April 2026 by Laura.donovan (talk | contribs) (Updated via BpClonePage extension. Source page: draft:AgentDesktop-client-side-javascript-api-specification/setInteractionActiveScreen)

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

setInteractionActiveScreen

Send to the Agent Desktop application arbitrary data that can be used to restore the current CRM screen state. The data will be received via the SDK callback onActivateInteractionScreen after the active interaction has been switched to another interaction being handled.

Request

Syntax

setInteractionActiveScreen(screenData: InteractionScreen, interactionId?: string): Promise<OperationResult<null>>

Where:

type InteractionScreen = Record<string, string | number | boolean | null | undefined>

Parameters

Parameter Parameter Values Data Type Optional/Required Description
screenData Required An arbitrary set of data, enough to restore CRM screen state.
interactionId String Optional The ID of interaction, for which you want to save screen data. If not provided, a variable will be set in for the currently active interaction.

Example Request

setInteractionActiveScreenButton.onclick = () => {

    let activeScreenData: any | null = null

    try {

        activeScreenData = JSON.parse(activeScreenTextarea.value)

    } catch (e) {

        alert('You have syntax error in the active screen data structure. Cannot parse JSON.')

    }

    if (!activeScreenData) {

        return

    }

    const itemId = activeAssociatedInteractionIdInput.value

    adApi.setInteractionActiveScreen(activeScreenData, itemId)

}

Return Value

null

< Previous | Next >