Skip to main content

#DataRaptor2 debatiendo

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 respuesta
  1. 20 ago, 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 created a dataraptor formula as below

IF(ISNOTBLANK(%LoanApp:Applicant:axisltd_Total_Net_Income__c%) && ISNOTBLANK(%LoanApp:Applicant:axisltd_Total_Other_Income__c%), FUNCTION('AxisOmniGetPicklistLabel','getIncomeDetail',(%LoanApp:Applicant:axisltd_Business_Income_Source__c%+'$'+%LoanApp:Applicant:axisltd_Total_Net_Income__c%+'$'+%LoanApp:Applicant:axisltd_Total_Other_Income__c%+'$'

+%LoanApp:Applicant:axisltd_Other_Income_Source__c%+'$')), [])

 

I want this formula to return [] if both incomes are blank.Any suggestions on this?

 

#Omnistudio #DataRaptor #Salesforce Developer #Salesforce

1 respuesta
  1. 15 oct 2024, 05:41

    IF(

        AND(

            ISNOTBLANK(%LoanApp:Applicant:axisltd_Total_Net_Income__c%), 

            ISNOTBLANK(%LoanApp:Applicant:axisltd_Total_Other_Income__c%)

        ), 

        FUNCTION(

            'AxisOmniGetPicklistLabel',

            'getIncomeDetail',

            (

                %LoanApp:Applicant:axisltd_Business_Income_Source__c% + '$' + 

                %LoanApp:Applicant:axisltd_Total_Net_Income__c% + '$' + 

                %LoanApp:Applicant:axisltd_Total_Other_Income__c% + '$' + 

                %LoanApp:Applicant:axisltd_Other_Income_Source__c% + '$'

            )

        ), 

        []

    )

0/9000

I have created an OmniScript with a step that contains number and edit block element. Edit block element acts as a table to have multiple rows. On clicking next it calls a data raptor which creates a record (using data from number element) for parent object A and multiple records (added via edit block) for child object B. On coming back to the same step and clicking next creates another record instead of updating the same record. I am not getting how I can load the step with records created after clicking next so I can have Ids of the records and I can use them as upsert key in DataRaptor. Is there any way I can have this scenario working in OmniScript by having parent and child information in one step?

#Omnistudio #DataRaptor

1 respuesta
  1. 5 may 2024, 01:58

    Approach 1: Utilizing Output Parameters and Session Variables:

    DataRaptor for Parent Record:

    In your initial DataRaptor that creates the parent record (Object A), add an Output Parameter. Name it something like parentId.

    1. Set the value of this parameter to the ID of the newly created parent record. This can be achieved using Apex code like {!record.Id} within the DataRaptor action.

    Store Parent ID in Session Variable:

    After the DataRaptor action that creates the parent record, use a Set Session Variable element in your OmniScript.

    Set the variable name to something like parentId and its value to the output parameter from the DataRaptor ({!$Flow.parentId}). This stores the parent ID in a session variable accessible throughout the script.

    DataRaptor for Child Records:

    In your DataRaptor that creates child records (Object B), use the {!$Flow.parentId} session variable to reference the ID of the parent record.

    Set the ParentId field on the child records being created to this session variable value.

    Optional: Refresh Step Data (if needed):

    If you need to display information about the newly created records in the same step, consider using a Refresh Step Data element after the DataRaptor actions. This will reload the step data with the updated information.

    Approach 2: Leverage Navigation with Data Parameters:

    DataRaptor for Parent Record:

    Configure your initial DataRaptor to create the parent record as usual.

    Navigation with Data Parameters:

    After creating the parent record, use a Navigate element in your OmniScript.

    In the navigation settings, choose the next step as the target step.

    Set Data Parameters. Create a parameter named parentId and set its value to the ID of the newly created parent record ({!record.Id}).

    Retrieve Data Parameter in Next Step:

    In the next step of your OmniScript, use a Get Data Parameter element.

    Set the parameter name to parentId to retrieve the ID passed from the previous step.

    DataRaptor for Child Records:

    In your DataRaptor that creates child records, use the {!$Flow.parentId} flow variable (populated from the Get Data Parameter element) to reference the ID of the parent record.

    Set the ParentId field on the child records being created to this variable value.

     

    Choosing the Right Approach:

    Approach 1 is simpler for basic scenarios where you don't need to display information about the newly created records in the same step.

    Approach 2 offers more flexibility if you need to access data from the previous step (parent ID) within the current step for display purposes.

0/9000

While updating a quote in a load DR, by passing the quote ID and status (status to be change), we are getting error:  Uncaught Exception: Script-thrown exception Please verify DRMapItems are all correct and notify Vlocity support if this is not related to mapping errors.

It was workin fine but suddenly it's getting an error. any idea what to be corrected? the DR is a very simple one. #DataRaptor #Omnistudio

2 respuestas
  1. 9 ene 2024, 10:43

    No it was unchanged since many years. It was due to the upgrade. It seems now if the formula in the DR is not returning any result, SF will not allow the DR to execute.

0/9000

Hello all,

As the title says, I'm trying to create a typeahead on a flexcard with a dataraptor for the data source. Most tutorials make use of OmniScripts, and while that is easier, I'd like to try it out using a FlexCard.  

 

I'm trying to retrieve a list of accounts where the names contain the flexcard's input.

 

I followed this Add a Typeahead Input Element to a FlexCard (salesforce.com) but I'm not getting any suggestions:

FlexCard Typeahead with DataRaptor not giving suggestions

 

The data is fetched as expected in my DataRaptor:

Input: AccName

Output:  Accountsdataraptor.png

 

Here is the Action:

Am I correct in putting in {AccName} in Field Binding? I mapped it to AccName in the Input Map in the Action Properties. But what I don't understand is, I'm not getting the expected Accounts node back (check 1st image)action.pngI'd appreciate any help you can give. 

#Flexcard #Typeaheadblock #DataRaptor #Omnistudio

4 respuestas
  1. 7 dic 2023, 16:32

    I submitted a case today about the preview feature not working on FlexCards. Once I hear about the case, I will work on it to see if I can tell what is going wrong.

0/9000

Hi All,

I'm currently working on an omniscript and I'm struggling to figure out how I can store the output of a new record ID in order to reference and update the same record in the omniscript - here's an outline of what I'm trying to achieve:

 

  • Step 1: customer provides address inputs (complete)
  • Integration Procedure (with load dataraptor): creates new record (complete)
    • How can I store the ID of this new record as variable (similar to how you can in lightning flows) - (still trying to determine how to do this)
  • Outside of omnistudio: google APIs trigger/Apex classes run logic to set data on new record (complete)
  • Extract the new record and use fields set by apex trigger/classes - ideally by record ID from integration procedure after Step 1
  • Step 2/3: dynamically display components based on the values fetched from new record
  • Integration Procedure (with load dataraptor): update the initially saved record (from the output record ID created in IP/DR used in step 1) using upsert key in IP/DR

 

TLDR;

Is there any way, similar to flows, that I can store the variable of the new record and reference it in other IPs/DRs in the same omniscript to update the record?

@* Service Cloud *

2 respuestas
0/9000

Hello Trailblazers,

I Am capturing First name into text field, using validation pattern not working in Omni script

/^[A-Z][a-zA-Z '.-]*[A-Za-z][^-]$/

Can anyone have any idea?

Thank you in advance

#Omnistudio #DataRaptor
4 respuestas
0/9000

Become project-ready in the Communications Cloud industry with this comprehensive course. 

 

Gain in-depth knowledge of key concepts such as 

OmniScripts, Flex Cards, DataRaptors, Lightning Web Components, Integration Procedures

 

Explore the core products that are integral to the industry, including the Enterprise Product Catalog (EPC), Configure, Price, Quote (CPQ), Order Management (OM), and Digital Commerce APIs.

 

By the end of this course, you will be equipped with the necessary skills and expertise to excel in the Communications Cloud industry and contribute to successful projects.

 

https://forcearkacademy.com/courses/Communications-Cloud-Professional-Course

 

#Communications Cloud  #CPQ #Order Management  #DigitalAdoption #Omnistudio #Flexcard #DataRaptor #LWC #Integration Platform

0/9000

Become project-ready in the Communications Cloud industry with this comprehensive course. 

 

Gain in-depth knowledge of key concepts such as 

OmniScripts, Flex Cards, DataRaptors, Lightning Web Components, Integration Procedures

 

Explore the core products that are integral to the industry, including the Enterprise Product Catalog (EPC), Configure, Price, Quote (CPQ), Order Management (OM), and Digital Commerce APIs.

 

By the end of this course, you will be equipped with the necessary skills and expertise to excel in the Communications Cloud industry and contribute to successful projects.

 

https://forcearkacademy.com/courses/Communications-Cloud-Professional-Course

 

#Communications Cloud  #CPQ #Order Management  #DigitalAdoption #Omnistudio #Flexcard #DataRaptor #LWC #Integration Platform

0/9000

Say I have a data raptor extract action "ABC " in omniscript returning the values as 

{

  "Name": "Akhil Saji",

  "DelegateAccId": "0015a00002GGhbJCCD",

  "RecordtypeName": "HCP"

}

 

I have another Data Raptor extract action "XYZ" which requires one input parameter- say ID. I need to pass my "DelegateAccId" from ABC to XYZ, so that my raptor can use this id to get some more data.

 

How to pass this?

 

How can I correctly pass the data in the "Input parameters section" of  XYZ?

 

How to pass node value from one dataraptor action to another?

Thanks in advance!

 

#Omnistudio@Vlocity #Vlocity #DataRaptor #Omnistudio

2 respuestas
0/9000