From Bright Pattern Documentation
Jump to: navigation, search
• 5.19


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 API callback onActivateInteractionScreen after the active interaction has been switched to another interaction being handled.



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


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


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) {



        const itemId = activeAssociatedInteractionIdInput.value

        adApi.setInteractionActiveScreen(activeScreenData, itemId)


Return Value

< Previous | Next >