Using Custom LWC inside Vlocity Omniscript – User friendly Tech help
Problem: Due to omniscript limitations, you might find the need to incorporate custom LWC to meet specific requirements.
Solution:
- Acquiring the Custom LWC:
- Obtain the custom LWC from the salesforce Lightning web components. For this example, we’re using a radio group.
- Incorporating into Omniscript Designer:
- Navigate to Omniscript Designer > Inputs and drag the “Custom LWC” into the desired step.
- Map the custom LWC (in this case, the radio group) under the “Lightning Web Component Name” section.
- Passing Custom Data:
- If you need to pass any custom data, perhaps from dataraptor, and want to utilize it in the custom LWC, you can do so.
- Modifications in .meta.xml File:
- Within the Custom LWC’s .meta.xml file, make the necessary changes. Ensure that the
runtimeNamespace
aligns with the vlocity vertical you’re working with. For instance, usevlocity_cmt
(namespace) for Communication orvlocity_ins
for insurance.
- Within the Custom LWC’s .meta.xml file, make the necessary changes. Ensure that the
- Code Implementation in .js File:
import { OmniscriptBaseMixin } from "vlocity_ins/omniscriptBaseMixin"; export default class customLWCRadioGroup extends OmniscriptBaseMixin(LightningElement) { // Include your lwc code here for the radio group as demonstrated above. }
Deployment:
- Deploy your changes related to the custom LWC to your sandbox. Once done, activate the omniscript, enable LWC in the script configuration, and preview the LWC.