Populate Dedicated Custom Field(s) For Related To Id
As part of the archive process, Email Scrubber populates the EmailScrubber__RelatedTo_Id__c field when the EmailMessage.RelatedTo field exists in the org and contains a value. If you need to map this value into a dedicated custom field on the archive object, a Custom Metadata Type is provided to define and manage that mapping.
​
This can be achieved in a few simple steps.
Create the Custom Field
Find the Email Scrubber Archive Email Message object.

Create a custom field for each related object whose Id you want to extract from the Related To Id. Create as many relationships as needed for your implementation.

Map the Fields
Map the Relation Type(s) to the Custom Field(s) in the Custom MetaData Type.

The RelatedTo Type is determined by matching the returned object type to the custom API field name defined in the Redundant EmailMessage API Field mapping. If you’re unsure which object type a specific record Id belongs to, you can run the following command to identify it:

This will return the SObject type name, which you can then use when configuring your custom field mappings.
Note: This configuration applies only to archive records created going forward. To populate these values for existing archived data, use a data loader to update the records.
