---
schema_version: "1"
id: 7c2f6e20238e93be5f96f19832f309208f18aea7171a4cd584d7f41bfec83245
title: Detect Data JSON Updates in an Embedded Omniscript (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_detect_data_json_updates_in_an_embedded_omniscript.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_detect_data_json_updates_in_an_embedded_omniscript.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ce492f2ecf705a436a08b50eae1c26cc7ec22adfbb53ad4127fc3472401c26f8
description: For the managed package runtime, detect changes in an embedded Omniscript's data JSON using the omniaggregate event.
products:
  - Omnistudio
release: "264"
---
# Detect Data JSON Updates in an Embedded Omniscript (Managed Package)

For the managed package runtime, detect changes in an embedded Omniscript's data JSON using the **omniaggregate** event.

![Managed Package app icon](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/resources-global/_corporate/images/managedpackageicon.png) This information is for Omnistudio for Managed Packages. For Omnistudio on standard runtime, see [Omnistudio Help](https://help.salesforce.com/s/articleView?id=xcloud.os_omnistudio_standard.htm&language=en_US).

1. In your Lightning Web Component's JavaScript file, add an event listener that accepts the omniaggregate event as an argument.
    
    ```
    this.template.addEventListener( 'omniaggregate');
    ```
2. Create a separate function that handles the response of the event and assigns the value to a variable.
    
    ```
    omniUpdateHandler(event) {
    	if(event.detail) {
            this.omniDataJSON = event.detail;
            // do something with the data JSON
        }
    ```
3. Add the function that handles the response as an argument to the event listener so that it fires whenever the Omniscript data JSON updates.
    
    ```
    this.template.addEventListener( 'omniaggregate', (event) => { this.omniUpdateHandler(event) });
    ```