Unify and manage your data

Pattern-based cleanser

Learn about the pattern-based cleanser.

The PatternBasedFieldBuilder cleanser generates output text per the pattern and attribute mappings you configure. When the cleanser runs on an entity profile, it adds a crosswalk for the resulting value that uses ReltioCleanser as its source, per the cleanse config settings.

Table 1. Options
KeyAllowed ValuesDescription
isForceBoolean (true/false)
  • True: Generates a value for the Name attribute if it is available.
  • False (default): Generates a value for the Name attribute if it isn't available or blank.
patternThis is the only pattern to generate the desired output.The output is generated as per the given pattern only. If no pattern is defined, the input values are arranged with spaces in between.
Note: Use the beforeSave LCA hook to enable the Pattern-Based Cleanser to work with nested attributes. For details on this LCA hook, see topic LCA Hooks.

Limitations

  • The pattern-based cleanser doesn't support reference attributes.
  • If you configure a named attribute as the desired target for the output of this cleanser and it uses a name other than OutputText, then the parameter isForce isn't available for use.

Example configuration

Map the PatternBasedFieldBuilder for any entity in your L3 configuration. Here is an example of a sample configuration:

{
  "uri": "configuration/entityTypes/HCP2",
  "cleanseConfig": {
    "infos": [
      {
        "uri": "configuration/entityTypes/HCP2/cleanse/infos/PatternBasedFieldBuilder",
        "useInCleansing": true,
        "sequence": [
          {
            "chain": [
              {
                "cleanseFunction": "PatternBasedFieldBuilder",
                "resultingValuesSourceTypeUri": "configuration/sources/ReltioCleanser",
                "proceedOnSuccess": true,
                "proceedOnFailure": true,
                "mapping": {
                  "inputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP2/attributes/Name",
                      "mandatory": false,
                      "allValues": false,
                      "cleanseAttribute": "Name"
                    },
                    {
                      "attribute": "configuration/entityTypes/HCP2/attributes/Organization/attributes/Name",
                      "mandatory": false,
                      "allValues": false,
                      "cleanseAttribute": "OrganizationName"
                    },
                    {
                      "attribute": "configuration/entityTypes/HCP2/attributes/Country",
                      "mandatory": false,
                      "allValues": false,
                      "cleanseAttribute": "Country"
                    }
                  ],
                  "outputMapping": [
                    {
                      "attribute": "configuration/entityTypes/HCP2/attributes/ShortNote",
                      "mandatory": true,
                      "allValues": false,
                      "cleanseAttribute": "OutputText"
                    }
                  ]
                },
                "params": {
                  "isForce": true,
                  "pattern": "{Name}, {OrganizationName} - {Country}"
                }
              }
            ]
          }
        ],
        "nestedAttributeToCleanse": "configuration/entityTypes/HCP2/attributes/Organization/attributes/Name"
      }
    ]
  },
  "attributes": [
    {
      "uri": "configuration/entityTypes/HCP2/attributes/Name",
      "label": "Name",
      "name": "Name",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    },
    {
      "uri": "configuration/entityTypes/HCP2/attributes/Country",
      "label": "Country",
      "name": "Country",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    },
    {
      "uri": "configuration/entityTypes/HCP2/attributes/Organization",
      "label": "Organization",
      "name": "Organization",
      "description": "",
      "type": "Nested",
      "hidden": false,
      "important": false,
      "attributes": [
        {
          "uri": "configuration/entityTypes/HCP2/attributes/Organization/attributes/Name",
          "label": "Name",
          "name": "Name",
          "description": "",
          "type": "String",
          "hidden": false,
          "important": false
        }
      ]
    },
    {
      "uri": "configuration/entityTypes/HCP2/attributes/ShortNote",
      "label": "ShortNote",
      "name": "ShortNote",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    }
  ]
}

Examples of input and output

Table 2. Example
OptionsInputs (InputText)Output (OutputText)

{ “isForce: false,
   “pattern”: I, “{FirstName} {LastName}, live in {Country}”
}
{
"FirstName": "Walter",
"LastName": "Bruce"
"Country": "USA"
}
{
"FirstName": "Walter",
"LastName": "Bruce"
"Country": "USA"
"OutputText":"I, Walter Bruce, live in USA"
}
{ “isForce: false,
   “pattern”: “{Address1}, {City}, <br>{Country} - {PostalCode}”
}
{
"Address1": "100 MAIN ST
",
"City": "SEATTLE WA
",
"Country": "USA
",
"PostalCode": "98104
"
}
{
"Address1": "100 MAIN ST",
"City": "SEATTLE WA",
"Country": "USA",
"PostalCode": "98104"
"OutputText":"100 MAIN ST, SEATTLE WA, <br>USA - 98104"
}