0151 355 4555

CleanName

Description

Returns a cleansed name alongside a number of salutations. Also returns gender as identified by given details.

View all Name Cleansing (contact us for more information about this service) methods

Code Samples

<!-- Import the Integr8 Ajax API -->
<!-- NOTE: Get your own API key to use in the following script tag from: -->
<!-- http://www.data-8.co.uk/integr8/Admin/Ajax.aspx -->
<script src="https://webservices.data-8.co.uk/Javascript/Loader.ashx?key=your-api-key" type="text/javascript">
</script>

<script type="text/javascript">

function loadIntegr8() {
  // Load the NameCleansing Integr8 service
  data8.load('NameCleansing');
}

function CleanName(name) {
  /// <param name="name">data8.name. Set up the Title, Forename, MiddleName, Surname properties before calling this method.</param>
  var namecleansing = new data8.namecleansing();
  
  namecleansing.cleanname(
    name,
    null,
    showCleanNameResult
  );
}

function showCleanNameResult(result) {
  // Check that the call succeeded, and show the error message if there was a problem.
  if (!result.Status.Success) {
    alert('Error: ' + result.Status.ErrorMessage);
  }
  else {
    // TODO: Process method results here.
    // Results can be extracted from the following fields:
    // result.Name
    // result.Gender
    // result.FormalSalutation
    // result.InformalSalutation
  }
}

loadIntegr8();

</script>