Customizing Member Anonymization
You can customize which member data is anonymized. Start by checking out the default configurations that will determine how individual member fields will be wiped, as well as which related records are to be modified or deleted upon anonymization.
Go to Salesforce Setup and, via quick find, navigate to Static Resources. Under the FieloPLT namespace, view the JSON file called MemberAnonymize. You'll see something like this:
{
"configObjects": [
{
"apiName": "FieloPLT__Member__c",
"relationships": "Id",
"deleteRelatedAttachments": true,
"deleteRelatedFiles": true,
"deleteTrackFieldHistory": false,
"configFields": [
{
"apiName": "Name",
"anonymizeOption": "defaultValue",
"value": "Anonymized"
},
{
"apiName": "FieloPLT__Account__c",
"anonymizeOption": "blank"
},
{
"apiName": "FieloPLT__Contact__c",
"anonymizeOption": "blank"
},
{
"apiName": "FieloPLT__Email__c",
"anonymizeOption": "defaultValue",
"value": "[email protected]"
},
{
"apiName": "FieloPLT__ExternalURL__c",
"anonymizeOption": "blank"
},
{
"apiName": "FieloPLT__Image__c",
"anonymizeOption": "blank"
},
{
"apiName": "FieloPLT__MergedTo__c",
"anonymizeOption": "blank"
},
{
"apiName": "FieloPLT__User__c",
"anonymizeOption": "blank"
}
]
},{
"apiName": "FieloPLT__EmailAlert__c",
"relationships": "FieloPLT__Member__c",
"configFields": [
{
"apiName": "FieloPLT__ToAddress__c",
"anonymizeOption": "blank"
}
]
}
],
"overrides": "false"
}Using the above JSON tree as a model, you can write your own files to add to or override these configurations. Start by creating a text file with the extension .json.
Each entry in "configObjects" contains settings that determine how fields in Member or objects with lookups to Member will be anonymized. These configs use the following key-value pairs:
| Key | Required? | Possible Values |
|---|---|---|
"apiName" | ✔️ | The API name of the object with fields to be anonymized. This object must be FieloPLT__Member__c or have a lookup to FieloPLT__Member__c. |
"relationships" | ✔️ | The API name(s) of the lookup(s) to FieloPLT__Member__c. If the object has more than one lookup to Member, separate each field name with a comma. If the object itself is Member, use "Id". |
"deleteRelatedAttachments" | Set this to"true" if you want to delete Attachments related to anonymized records, and"false" otherwise. The default value is"false". | |
"deleteRelatedFiles" | Set this to"true" if you want to delete Files related to anonymized records, and"false" otherwise. The default value is"false". | |
"deleteTrackFieldHistory" | Set this to "true" if you want to delete field history related to anonymized records, and "false" otherwise. The default value is "false".NOTE: Anonymization will fail if this attribute is set to "true" and the object doesn't have field tracking turned on. You must also ensure that your users have Delete from Field History and Delete from Field History Archive permissions enabled. | |
"configFields" | ✔️ | See table below. |
In "configFields", you specify each field you want to be anonymized and how:
| Key | Required? | Possible Values |
|---|---|---|
"apiName" | ✔️ | The API name of the field to be anonymized. |
"anonymizeOption" | ✔️ | Use"blank" to delete all of the content in the field or"defaultValue" to overwrite the field content with another value. |
"value" | Only if "anonymizeOption" is "defaultValue" | If you set"anonymizeOption" to"defaultValue", this is where you specify the value you want to override an anonymized field with. This can be any string. If the field is numerical, make sure this string is a valid number. If the field is of type Date or Date/Time, be sure to express the value as follows: DDMMYYYY where DD is the day, MM is the month and YYYY is the year. |
Finally, in "overrides", you can specify whether your configurations will add to or replace any existing configurations in the same library. If you set it to "true", the configurations will supersede any others. If "false", they will be applied along with any other configurations in the library. Note that the default config has "overrides": "false". So, in your file, you can choose to add your own configurations to the default ones (by setting "overrides" to "false") or override all the default configs with your own file (by setting "overrides" to "true").
Once your config file is ready, you can upload it to Salesforce as a static resource. Then, link it to the FieloPLT library to start using it.
