In order to enrich your records with the additional data that our validation components offer, you will need to set up a Touchpoint. These contain mappings for the additional enrichment data, metadata or components that can then be retrieved and utilized within your custom Lightning Web Component (LWC).
When working with an embedded LWC we need to use an Unbound Touchpoint. This means that the Touchpoint is not linked to a specific Salesforce object and field as a regular Bound Touchpoint would be. Mappings within Unbound Touchpoints are made to aliases rather than object fields, meaning that you can name them whatever you want.
Follow the instructions found in our Touchpoint section on creating an Unbound Touchpoint and make a note of the Touchpoint API name and aliases you configure. The API name is passed as an attribute to our validation components and the aliases will be the field names that will appear in the event.detail object when binding to the onmappedfieldschange event.
To assign your Touchpoint to a validation component, enter your Touchpoint API name from the previous step into the touchpoint-api-name attribute. Here's an example for the API name Contact_Email_Unbound:
<template>
<texperianledq-ledq-cmp-email-validate-flow
field-label="Email"
help-text="Help"
touchpoint-api-name="Contact_Email_Unbound"
onvalidationstatuschange={handleValidationStatusChange}
onfieldchange={handleFieldChange}
onmappedfieldschange={handleMappedFieldsChange}
></texperianledq-ledq-cmp-email-validate-flow>
</template>
To bind an event listener to onmappedfieldschange, you will need to define a function within your custom LWC to pick up the event object. Its detail.mappings property will contain all the fields that are mapped in the assigned Touchpoint. Here you can see an example where the function is called handleMappedFieldsChange and the alias configured is called domain_type_alias:
handleMappedFieldsChange(e) {
this.domainType = e.detail.mappings.domain_type_alias;
}