--- title: Configure the Data visualization component instance description: Configure the Data visualization component instance so that your users can embed it on their website to display information in the form of single score, pie chart, donut chart, or semi-donut chart directly from any ServiceNow table. locale: en-US canonical_url: https://www.servicenow.com/docs/r/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/config-data-viz-comp.html release: australia product: Customer Self-service and Omnichannel Engagement classification: customer-self-service-and-omnichannel-engagement topic_type: task last_updated: "2026-03-12" reading_time_minutes: 6 breadcrumb: [Data visualization component, Configure web components, Web Embeddables, Set up self-service, Configure, Customer Service Management] --- # Configure the Data visualization component instance Configure the Data visualization component instance so that your users can embed it on their website to display information in the form of single score, pie chart, donut chart, or semi-donut chart directly from any ServiceNow table. ## Before you begin You must have the following setup to configure the Data visualization component instance: - Enable Web Embeddables in your instance. For more information, see [Activate Web Embeddables](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/act-web-embeddables.md). - [Set up a custom URL as the instance URL](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/set-up-custom-url.md). - Authenticate the ServiceNow components using OpenID Connect \(OIDC\) or non OIDC authentication. For more information, see [Authenticate the ServiceNow components using OIDC](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/authenticate-sn-webcomponents-oidc.md) and [Non OIDC authentication for ServiceNow components](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/auth-sn-webcomponents-non-oidc.md). Role required: sn\_embeddable\_core.emb\_admin ## Procedure 1. Navigate to **All** > **Web Embeddables** > **Homepage**. 2. In the homepage, select Create module or use the existing module. For more information on creating a new module, see [Create a module](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/create-we-module.md). 3. On the module page, in the Components tab, add a Data visualization component instance to an existing or a new group. For more information on creating a group and then adding a component instance, see [Create a group and add a component instance](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/we-create-group-and-add-comp-instance.md). 4. Configure the Data visualization component instance properties. - The Preview tab displays real-time data according to choices set in the component properties. - For a description of the component properties related to the Data visualization component instance, see [Component properties for the Data visualization](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/we-data-viz-comp-prop.md). 5. Select the **CORS rules** tab to configure the CORS rules. For more information about configuring CORS rules, see [Configure CORS \(Cross-Origin Resource Sharing\) rules before embedding ServiceNow components](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/configure-cors-for-web-components.md). 6. Select the **Components** tab. If a message appears about the application scope, change the scope to **Web Components for Customer Service** to be able to edit the record. 7. Select **Get embed code**. A pop-up window appears to display both Global code and Component code. 8. In the Global code tab, review the generated code and select the **Copy global code**. The global code must only be added once to your third-party webpage. ``` import { init, login, logout, startGuestSession } from 'https://demo.servicenow.com/uxasset/externals/sn_embeddable_core/index.jsdbx'; await init({ theme: 'fad87d2ca304121029a4d1aed31e610f', /* sys_id of the theme to use for the embeddable components in your website */ baseURL: 'https://demo.servicenow.com', /* Base URL of the instance to be used for the embeddable components in your website */ authCallback: getTokenCallBack, /* Function which returns the auth token for the current user, required for auth setup */ module: '591800ffc1243610f87714367ed47c6a', /* Demo module */ pageName: document.title, /* Uses the browser's document title as the page name in User analytics experience */ guestTokenCallback: getGuestJWTTokenCallBack, /* Function which returns the guest token for the current user, required for guest validation setup */ cacheComponents: [] /* Pre-caches resources for improved performance. Update component list as per your usage */ }); function getTokenCallBack() { var idToken; /* Get the id token for the current user */ return Promise.resolve(idToken); } function getGuestJWTTokenCallBack() { var guestToken; /* Get the guest token for the current user */ return Promise.resolve(guestToken); } /* Uncomment below function to handle guest session */ // await startGuestSession(); /* Uncomment below functions to handle login and logout once the user logs into your website */ // await login(); // await logout(); ``` 9. In the Component Code tab, slide the **Enable event handler** toggle switch to handle events triggered by the user interactions on the website. **Note:** Enabling the event handler also modifies the component code. For more information on event handlers in Web Embeddables, see [Event handler in the Data visualization component](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/we-data-viz-event-handler.md). 10. In the Component code tab, review the generated code and select the **Copy component code**. The generated component code also includes configurations for event handlers and a donut chart. ``` ``` ## Result The global and component codes are ready to be shared with the third-party administrator to embed the Data visualization component instance on their third-party website. ## What to do next [Embed the Data visualization component instance on the third-party website](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/embed-data-viz-comp.md) **Related topics** [Component properties for the Data visualization](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/we-data-viz-comp-prop.md) [Event handler in the Data visualization component](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/we-data-viz-event-handler.md) [Sample code for the Data visualization component](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/customer-service-management/customer-self-service-and-omnichannel-engagement/we-data-viz-sample-code.md)