Skip to main content

#Omnistudio9 diskutieren mit

Context

We have an OmniScript that calls DataRaptor/Integration Procedure remote actions to pull data. When a device loses network mid-session, the remote action call fails and OmniScript throws a hard error instead of degrading gracefully. A red error banner names the failing element, shows true underneath, and the "Continue" button doesn't actually recover the flow. 

 

Fix implemented

Before triggering the DataRaptor/IP remote action, we register listeners for the browser's connectivity events:

js

window.addEventListener("online", handleOnline);

window.addEventListener("offline", handleOffline);

On offline → we set a flag and intercept the remote action call, showing a friendly "you're offline" message instead of letting the call fail and throw the error block.On online → we clear the flag and let the remote action proceed normally.

We also check navigator.onLine at call-time as a secondary guard.

This works correctly for every user we've tested, across web (all major browsers) and Mobile Publisher — the offline event fires reliably, our handler runs, and the graceful message shows up instead of the hard error.

The problem

For exactly one user, on Chrome, neither the offline event nor the online event appears to fire at all when the device's actual connectivity changes. Because our handler never runs, the flag never gets set, the remote action call goes through as if the device were offline, and the original OmniScript error surfaces.

 

Affected environment

  • OS: Ubuntu 24.04.2 LTS
  • Device: Lenovo laptop
  • Chrome: Version 151.0.7922.137 (Official Build) (x86_64)

Question for the community

Has anyone seen window.addEventListener("online"/"offline") fail to fire on Chrome for Linux (Ubuntu 24.04) on a specific machine, in an OmniScript/LWC context, while working fine on the same OS/browser combo for other users?  

 

Thanks!

 

 

#Salesforce  #Omnistudio  #DataRaptor  #Chrome Browser

1 Antwort
  1. 20. Aug., 15:24

    Hi Rakesh - the root issue is that the window online/offline events (and navigator.onLine) are inherently unreliable, and Linux Chrome is the worst case. Chromium marks the browser 'online' whenever there is any network interface with an IP - even a virtual or IPv6 adapter with no real internet - and it often never fires the offline event on Linux. So on that one Ubuntu user's machine the events genuinely will not fire; it is a documented Chromium limitation, not your code. 

     

    So do not gate your OmniScript logic on those events. Two robust patterns instead: 

     

    1. Handle the failure at the call, not before it. Wrap the DataRaptor IP remote action so that when it fails (network error or timeout) you catch it and show your friendly 'you are offline' message plus a real retry - rather than trying to predict offline up front. In OmniScript, use the element's error handling / a Set Errors plus conditional navigation so the hard error banner never shows. 

     

    2. If you want a proactive signal, run a lightweight heartbeat - a periodic fetch to a tiny known endpoint with a short timeout - and treat a failed or timed-out fetch as offline. That actually tests reachability, which the browser events do not. 

     

    navigator.onLine is fine as a hint (if it says false, you are definitely offline), but never as the source of truth. Catching the actual remote-action failure is what fixes the ungraceful error for everyone, including that Ubuntu user. 

     

    If this helps, please mark it as the Best Answer so it helps the next person - thanks :)

0/9000

Hi everyone,

I'm facing an issue with an OmniScript File Upload on an Experience Cloud site.

The file uploads successfully and a ContentVersion record is created. However, the Experience Site (guest/external) user is unable to retrieve or access the returned ContentVersion Id (vId) after the upload completes. In some cases, the upload appears successful, but the vId is blank or unavailable for subsequent steps in the OmniScript.

Our goal is to use the returned ContentVersion/ContentDocument information later in the flow to associate the uploaded document with a Case record.

Has anyone encountered this issue with OmniStudio File Upload components on Experience Sites? Are there any known limitations, sharing settings, guest user restrictions, or permissions required for external users to access the generated ContentVersion Id after upload?

Any guidance would be greatly appreciated.

Thanks! 

 

#Omnistudio  #Upload Files  #Experience Cloud  #Guest User

7 Antworten
0/9000

Has anyone successfully overridden the OmniScript Step Chart using LWC in Standard Designer/Standard Runtime (not the OmniStudio managed package)?    I'm getting this error when extending `omniscriptStepChart`:    `No MODULE named markup://omnistudio:omniscriptStepChart found`    Has anyone encountered this or found a workaround? Any help would be greatly appreciated!   

1 Antwort
0/9000

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?

#Omnistudio
1 Antwort
  1. 21. Juni, 01:11

    If the JSON is being updated correctly, then the issue is likely related to the OmniScript UI not re-rendering after the LWC updates the data.

    A few things I'd check:

    •  Make sure the data is being updated through omniApplyCallResp() or another supported OmniScript API. 
    •  Verify whether the read-only fields are bound directly to the updated JSON node. 
    •  Some OmniScript elements don't automatically refresh when data changes outside their lifecycle. In those cases, navigating to the next step and back often confirms whether it's a rendering issue rather than a data issue. 
    •  If you're using a custom LWC, you may need to trigger a refresh/re-render after updating the OmniScript data. 

    If the values appear correctly in the OmniScript JSON but not on screen, focus on how those specific read-only fields are being rendered and whether they're re-evaluating their data source after the update.

0/9000

Hey everyone, I’m stuck with a Salesforce Time field issue.

In OmniScript, when a user selects 2:00 PM, the JSON shows it as 14:00, but DataRaptor gives an “invalid value: 14:00” error.

Earlier we used DateTime, and Salesforce stored a converted UTC time like 18:00:00.000Z, which shifted the actual time.

Even in the UI, Salesforce converts and stores the time differently (e.g., 2:00 PM becomes 14:00:00.000Z), and sometimes shifts again on update.

Has anyone figured out the correct way to save Time values from OmniScript to Salesforce without timezone issues?

#Omnistudio
1 Antwort
  1. 1. Juni, 15:17

    Hi, 

     

    Transform the value before passing to DataRaptor

     

    Option A — Formula Element in OmniScript Add a Formula element after the Time picker:

    %timeField% & ":00.000Z"

    This turns 14:00 → 14:00:00.000Z. Map this formula output to DataRaptor, not the raw picker value. 

     

    Option B — SetValues / DataJSON manipulation Use a SetValues element to construct the correct string:

     

    json

    {

    "transformedTime": "{timeField}:00.000Z"

    }

     

    Option C — Integration Procedure (recommended for complex flows)

    Use a Transform action in an Integration Procedure to append :00.000Z before the Load step hits Salesforce. 

     

     

0/9000

Hello, I've noticed that after deploying integration procedures that have changes to the target environment the integration procedure executes without the latest changes in place. In order for the updates to reflect, I have to deactivate and activate the integration procedures affected. 

 

I was wondering if there is a better way to do this where a post deployment step of manually deactivating and activating the IPs can be avoided. Appreciate the help. Thanks! 

 

#Omnistudio

3 Antworten
  1. 31. Mai, 08:45
    Yes, this needs to be performed as a post deployment step. We've raised this concern with Salesforce, as it's a task when more IPs/OS are deployed.
0/9000

Hi everyone,

I'm currently working with OmniStudio Document Generation in an OmniScript, and I have a question regarding the "UseTemplateDRData" checkbox in the Arrange Template (Reorder Templates) step.

By default, this checkbox is always unchecked, and I would like it to be checked automatically for all selected templates.

Do you know if there is a way to:

  •  Set "UseTemplateDRData" = true by default
  •  Either via OmniScript configuration, DataRaptor, or any other workaround? 

I’m currently using multiple steps (template selection + additional documents), and I want to avoid users having to manually check this every time.

Any help or best practices would be greatly appreciated!

Thanks in advance 🙏 

Set

 

#Omnistudio

5 Antworten
  1. 30. März, 19:55

    Seems like not doable. I tried setting 'UseTemplateDRData' to true but it didn't worked. When you Preview the omniscript this is shown for that lwc component. I also found only this doc for the lwcSeems like not doable. I tried setting 'UseTemplateDRData' to true but it didn't worked. When you Preview the omniscript this is shown for that lwc component.

0/9000

I'm looking on how to pass the selected rows in a Flexcard data table to a parent omniscript. In this piece of documentation it only says that everytime a row is selected it triggers the "selectrow" event, but I'm not being able to get the event details in a parent omniscript not even in the parent flexcard. I'm not quite sure on how to handle the event listener (not to mention that since I can't see the event, I'm clueless on how to save the array sent by it).

Flexcard data table selectrow event handling how-to

Datatable Flexcard #Omnistudio

34 Antworten
  1. 19. Nov. 2022, 01:56

    Hi @Walter Fernandez. You can add the FlexCard to an LWC and handle the event programmatically as per https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.events_handling. See 'Attach an Event Listener Programmatically.'  The code below defines an LWC that updates the OmniScript JSON with the selected rows. Also useful: https://help.salesforce.com/s/articleView?id=sf.os_datatable_lightning_web_component_readme.htm&type=5

     

    Update: video explanation of selectrow event handling here: https://www.youtube.com/watch?v=WnHIXSzcdKM

    Update 2: see this resource for more details and sample code on this topic  https://quip.com/ftaxAqKJknkj

     

    <template>

        <!-- Embedded Flexcard -->    

        <c-cf-test-data-table-selectable></c-cf-test-data-table-selectable>    

    </template>

      

    import { LightningElement, api, track } from 'lwc';

    import { OmniscriptBaseMixin } from 'omnistudio/omniscriptBaseMixin';

    export default class DatatableSelectable extends OmniscriptBaseMixin(LightningElement) {

    selectedRows=[];

    connectedCallback(){

    this.template.addEventListener('selectrow', evt => {

    console.log('selectrow event', JSON.stringify(evt.detail.result));

    // if event's selectrow is true, add it to selectedRows; if false, it's been unchecked >> remove it

    if (evt.detail.result.selectrow) {

    this.selectedRows.push(evt.detail.result);

    } else {

    this.selectedRows.forEach(function(item, index, object) {

    if (item.uniqueKey === evt.detail.result.uniqueKey) {

    object.splice(index, 1);

    }

    })

    }

    this.omniApplyCallResp({"selectedRows": this.selectedRows });

    });

    }

    }

0/9000

Our users are having issues with our document generation procedure since our org was updated to Spring 26’

Running the procedure will sometimes just pull nothing through to the document at all and it’s a blank page.

But then if they retry 30 seconds later it works, tried diagnosing but can’t find an issue.

Anyone else experiencing this?

#Omnistudio
1 Antwort
0/9000

The Lightning Design System "Downloads" section

 reads: 

 

"It is no longer necessary to add a static resource for Lightning Components running within Lightning. See the FAQ for more information." 

 

But the FAQ link is 404. 

 

I'm asking because one of our developers wants to create and upload an SLDS static resource into a new repository and I'm wondering, "Is this really necessary?"

2 Antworten
  1. 31. Jan., 12:54

    In my case, we're trying to access SLDS icons from inside an Omniscript Output Text block. 

     

    Today's it's an image with src="" the static resource we loaded.  I was able to get it working without the resource in an LWC, but I guess the issue now is just

    #Omnistudio Omniscript.

0/9000