Accelerate the Value of Data

Pattern-based cleanser

The pattern-based cleanser generates output text as defined by the pattern and attribute mappings the user configures.

Cleanser Name - PatternBasedFieldBuilder

Description - This cleanser generates output text as defined by the pattern and attribute mappings the user configures. 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 is not 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.

Limitation - 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.

L3 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",
                      "mandatory": false,
                      "allValues": false,
                      "cleanseAttribute": "Organization"
                    },
                    {
                      "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}, {Organization} - {Country}"
                }
              }
            ]
          }
        ]
      }
    ]
  },
  "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": "Description",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    },
    {
      "uri": "configuration/entityTypes/HCP2/attributes/ShortNote",
      "label": "ShortNote",
      "name": "ShortNote",
      "description": "",
      "type": "String",
      "hidden": false,
      "important": false
    }
  ]
}

Example

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"
}