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


---

# Sample code for the Playbook intake component

# Sample code for the Playbook intake component {#ariaid-title1}

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

Sample code is provided to define an action when an event is triggered. Update the sample code for your use case before embedding the component on your webpage.

## Sample code {#we-playbook-intake-sample-code__section_icb_jyn_c2c}

    { 

    'SN_EMBEDX_PLAYBOOK_INTAKE#COMPONENT_READY' : (e) => { 

    // This event is dispatched when a component is ready and usable. 

    }, 

    'SN_EMBEDX_PLAYBOOK_INTAKE#COMPONENT_ERROR' : (e) => { 

    // This event is dispatched when a property validation or internal error occurs. 

    var {errorType, errorMessage} = e.detail.payload; 

    console.log(errorType, errorMessage); 

    }, 

    'SN_EMBEDX_PLAYBOOK_INTAKE#RECORD_CREATION_SUCCEEDED' : (e) => { 

    // Dispatched when a record is created by a Record Generator Playbook. 

    var {table, sysId, number, playbook_experience_id, hide_record_creation} = e.detail.payload; 

    if(hide_record_creation){ 

    var primaryURL = '/caseview'; // Replace with the URL of the case view page 

     

    // Construct the URL for the Case View component with URL parameters 

    const caseViewURL = primaryURL + '?emb_table=' + table + '&emb_recordid=' + sysId + (playbook_experience_id === '98e09a560f2200102920c912d4767e1a' ? '' : '&emb_playbook_experience=' + playbook_experience_id); 

    open(caseViewURL,'_self'); // Open case record when record created confirmation is hidden 

    } 

    }, 

    'SN_EMBEDX_PLAYBOOK_INTAKE#PRIMARY_BUTTON_CLICKED' : (e) => { 

    // This event is dispatched when primary button is clicked on the record created confirmation page. 

    var {table, record_sys_id, playbook_experience_id} = e.detail.payload; 

    var primaryURL = '/caseview'; // Replace with the URL of the case view page 

     

    // Construct the URL for the Case View component with URL parameters 

    const caseViewURL = primaryURL + '?emb_table=' + table + '&emb_recordid=' + record_sys_id + (playbook_experience_id === '98e09a560f2200102920c912d4767e1a' ? '' : '&emb_playbook_experience=' + playbook_experience_id); 

    open(caseViewURL,'_self'); // Open case record when primary button is clicked 

    }, 

    'SN_EMBEDX_PLAYBOOK_INTAKE#SECONDARY_BUTTON_CLICKED' : (e) => { 

    // This event is dispatched when secondary button is clicked on the record created confirmation page. 

    var {table, record_sys_id} = e.detail.payload; 

    var secondaryURL = '/browse'; // Replace with the URL of the secondary page 

     

    // Open the Case View component in the same tab 

    open(secondaryURL,'_self'); 

    }

**Tarefas relacionadas**   

* [Configure the Playbook intake component instance](https://servicenow-prod.fluidtopics.net/FCQJ~C0tuWeOwh2NvMBwuA "Configure the Playbook intake component instance so that your users can embed it on their website and submit cases using playbook guided experience from their website directly.")
* [Embed the Playbook intake component instance on the third-party website](https://servicenow-prod.fluidtopics.net/Rksjbu8a2ccZf6XYV_~Low "Embed the global code and component code of the Playbook intake component instance that you configured so that you can enable your customers to start creating a case using the playbook guided experience on your third-party website.")  
**Referência relacionada**   

* [Component properties for the Playbook intake](https://servicenow-prod.fluidtopics.net/twmHJsBE543XNgUqFrdaFQ "Component properties enable you to configure the behavior of the Playbook intake component instance on the third-party website.")
* [Event handler in the Playbook intake component](https://servicenow-prod.fluidtopics.net/F9AaHkutpFyWSvrOZDXG8A "A component triggers an event when a certain condition is met or on user interaction. The event can be used to execute an action through a code on a third-party webpage.")

