How to modify the include regex option in SFDMU configuration?


Question:

Based on the provided configuration snippet for SFDMU, how can we remove the include regex option for anonymizing data?

{
  "objects": [
    {
      "operation": "Upsert",
      "externalId": "FirstName;LastName;Email",
      "mockFields": [
        {
          "name": "Phone",
          "pattern": "phone",
          "excludedRegex": "",
          "includedRegex": ""
        },
        {
          "name": "Fax",
          "pattern": "phone",
          "excludedRegex": "*"
        }
      ],
      "master": false,
      "query": "SELECT Id, Name, updateable_true FROM Contact",
      "updateWithMockData": true
    }
  ]
}

Answer:

To adjust the configuration for removing the include regex option in SFDMU, you simply omit the includedRegex and excludedRegex fields from the mock fields unless specific filtering is necessary.

Here is the revised export.json configuration that reflects this change:

{
    "objects": [
        {
            "mockFields": [
                {
                    "name": "Phone",
                    "pattern": "phone"
                },
                {
                    "name": "Fax",
                    "pattern": "phone",
                    "excludedRegex": "*"
                }
            ],
            "query": "SELECT Fax, Id, Phone, updateable_true FROM Contact WHERE Email = 'asong@example.com' LIMIT 1",
            "operation": "Upsert",
            "updateWithMockData": true,
            "externalId": "FirstName;LastName;Email"
        }
    ]
}
Notes:
  • In this updated configuration, the Phone field will be anonymized, but the Fax will not due to the presence of the excludedRegex wildcard, which matches any value.
  • It's important to ensure that all fields listed in the mockFields array are explicitly included in the query to be effectively anonymized.
Last updated on 20th Apr 2024