Skip to main content

We're utilizing the Google API to search for an address and populate five read-only fields in Omni script if the address is found. If not, we're providing users with the option to manually enter the address via an LWC pop-up screen. After they've entered the address, we return to the Omni script. Although the fields are updating in JSON, the old values persist on the screen. How can we refresh the screen to display the new address data?

#Omni Channel
1 answer
  1. Jun 1, 3:22 PM

    Hi, 

     

    omniUpdateDataJson() updates the DataJSON but doesn't trigger UI re-render on OmniScript elements — their local state stays stale. 

     

    Fix: Use omniApplyCallResp(payload) instead — it updates the JSON and forces UI refresh.

    const addr = {

    AddressLine1: '123 Main St',

    City: 'Noida',

    PostalCode: '201301'

    };

    this.omniApplyCallResp(addr);

    Requirements:

    • LWC must extend OmniscriptBaseMixin
    • Payload keys must exactly match OmniScript element names (case-sensitive)
    • For nested step data, use { StepName: { FieldName: value } }

    If still not refreshing, chain both:

    this.omniUpdateDataJson(addr);

    this.omniApplyCallResp(addr);

0/9000