---
schema_version: "1"
id: 112d960ab5f77dd1aab9f7fa4edd75df2cf602ed7b4d7fde0c90712ca4c2ea24
title: Mapping of Responses to the Omniscript's Data JSON (Managed Package)
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/os_map_responses_to_the_omniscript_s_data_json.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.os_map_responses_to_the_omniscript_s_data_json.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: a3a4eb3ed397e80d60adef8ad0e054c9af2f50fd70db15a98b3a2aec531c4dcd
description: For the managed package runtime, beginning with Vlocity Insurance and Health Winter '20 and CME Winter '20 , apply responses from custom actions using the omniApplyCallResp() method.
products:
  - Omnistudio
release: "264"
---
# Mapping of Responses to the Omniscript's Data JSON (Managed Package)

For the managed package runtime, beginning with Vlocity Insurance and Health Winter '20 and CME Winter '20 , apply responses from custom actions using the `omniApplyCallResp()` method.

![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).

The method accepts an object that it passes into the Omniscript's data JSON. If the root data node name in the response matches an element name in the Omniscript, that data prefills the element, and any nested elements, when it renders in the Omniscript. If the root node name does not match an element in the data JSON, the node inserts into the data JSON immediately. Applying the response works similar to the Send/Response property. For information, see [Manipulate JSON with the Send/Response Transformations Properties (Managed Package)](https://help.salesforce.com/s/articleView?id=xcloud.os_manipulate_json_with_the_send_response_transformations_properties.htm&release=264.0.0&type=5 "For the managed package runtime, specify and transform the input and output JSON of Omniscripts or Integration Procedures with the Send and Response Transformation properties. The Send properties transform the input; the Response properties transform the output.").

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_note.png)

Note The method can't support proxy objects. To include proxy inputs, you must first clone the input object by using JSON.parse and JSON.stringify and then pass it to the method, as shown in this example.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_example.png)

Example

```
input = JSON.parse(JSON.stringify(input)); 
this.omniApplyCallResp(input);
```

**Method**: `omniApplyCallResp(response, usePubsub = false)`

**Arguments**:

- **response**: The first argument, `response`, is an object that merges into the data JSON.
- **usePubSub**: The second argument, `usePubSub,` controls how the response passes up to the Omniscript header to merge into the data JSON. This boolean is set to false by default. When set to **false**, `response` is sent to the Omniscript header via javascript events. When set to **true**, `response` is sent to the Omniscript header by the pubsub module.
    
    The usePubSub argument enables users to call `omniApplyCallResp` asynchronously. When running asynchronously, the UI is not blocked waiting for the response.
    
    Optionally perform a remote call by using the omniNextStep() method and calling the `omniApplyCallResp()` method asynchronously.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-xcloud-omnistudio_for_managed_packages-264-0-0-production-enus/aa2554ec-624a-4ee6-8da4-6435670e6e62/images/icon_example.png)

Example

This example demonstrates how the omniApplyCallResp() method updates Data JSON.

1. View the current data JSON before running omniApplyCallResp().
    
    ```
    {
                         "Step1" : {
                         "Currency1" : 12345,
                         "Text1" : "data1"
                         },
                         "Step2" : {
                         "Text3": "data3"
                         }
                         }
    ```
2. Call omniApplyCallResp and pass data as an argument.
    
    ```
    let myData = {
                         "Step1" : {
                         "CustomLWC1" : "newprop"
                         },
                         "Anotherprop" : {
                         "prop1" : "anothervalue"
                         }
                         }
                         
                         this.omniApplyCallResp(myData);
    ```
3. View the updated data JSON.
    
    ```
    {
                         "Step1" : {
                         "Currency1" : 12345,
                         "Text1" : "data1",
                         "CustomLWC1" : "newprop"
                         },
                         "Step2" : {
                         "Text3": "data3"
                         },
                         "Anotherprop" : {
                         "prop1" : "anothervalue"
                         }
                         }
    ```