Validate Addresses with Power Automate: Melissa Personator (Unbound Action)

Melissa - Configuration

Overview

Address Validation for Dataverse exposes Melissa Personator as a Dataverse action named sharpxrm_PersonnatorCheck (display name Sharp XRM - Personator Check; note the double nn in the unique name). Power Automate can call it with the standard Microsoft Dataverse connector and its Perform an unbound action step.

This action works differently from the Google and Azure Maps actions. You do not send it an address. You send it the row to validate (the Target) and, optionally, a Field Mapping. The action then:

  1. reads the address columns defined in the Field Mapping from the row,
  2. calls Melissa Personator with the actions and request columns configured on the Field Mapping,
  3. updates the row itself with the results, according to the Field Mapping and its Additional Mappings.

Your flow therefore does not map outputs to columns. It triggers the validation and can then report on, or react to, the result codes.

Example flow that validates a contact with Melissa Personator

Before you start

  • Address Validation for Dataverse is installed, with a valid license. Without one, the action fails with PCE02-01.
  • An active API Configuration row with Validation Service Type = Melissa Personator and your Melissa license key. See Setup your Melissa API Key.
  • An active Field Mapping row for the table you validate (for example Table Name = contact) whose Api Configuration Record is the Personator configuration. The Field Mapping defines:
    • which columns hold the address (Address Line 1, City, State/Province, Postal Code, Country, and so on),
    • the Personator actions to run (Check, Verify, Append, Move) and the Personator Request Columns,
    • Overwrite existing data with verified data: Yes writes the results back into the same address columns. No writes them into the destination columns defined on the mapping.
    • Additional Mappings that copy extra Personator outputs into columns. For example, map Results to a Validation Result column if you want the result codes stored on the row and available to your flow.
    See Configure Background Address Validation: Field Mapping and Workflows.
  • A Microsoft Dataverse connection in Power Automate. The account behind the connection must be able to update the target rows, because the update is made on behalf of the calling user.

How the example flow works

  1. When a row is selected (Contacts): users run the flow from the Flow menu on a contact.
  2. Contact ID (Compose): the selected contact's ID.
  3. Get Personator field mapping (List rows): finds the active Field Mapping for contacts that uses a Melissa Personator configuration.
  4. Field mapping found (Condition): stops with a clear error if there is none.
  5. Validate with Melissa Personator (Perform an unbound action): validates and updates the contact.
  6. Get contact result codes (Get a row by ID): reads the Validation Result column filled through the Additional Mapping, plus the updated address.
  7. Validation summary (Compose): builds a readable summary for the run history.
  8. Melissa reported a failure (Condition): marks the run as failed when Melissa returned a transmission error.

When a row is selected trigger on the Contacts table

Find the Field Mapping

The example looks up the Field Mapping with a FetchXML query, so the flow works in any environment without hard-coded IDs. Use List rows with Table name = Field Mappings and this Fetch Xml Query. The value 229000001 is the Melissa Personator validation service type:

<fetch top='1'><entity name='sharpxrm_addressvalidationfieldsconfig'><attribute name='sharpxrm_addressvalidationfieldsconfigid'/><filter><condition attribute='sharpxrm_entityname' operator='eq' value='contact'/><condition attribute='statecode' operator='eq' value='0'/></filter><link-entity name='sharpxrm_sharpxrmconfiguration' from='sharpxrm_sharpxrmconfigurationid' to='sharpxrm_apiconfigurationrecord' alias='cfg'><attribute name='sharpxrm_name'/><filter><condition attribute='sharpxrm_validationservicetype' operator='eq' value='229000001'/><condition attribute='statecode' operator='eq' value='0'/></filter></link-entity></entity></fetch>

List rows action that finds the Melissa Personator field mapping

If you only have one Personator Field Mapping for the table, this step is optional. When no Field Mapping ID is passed, the action finds it automatically (see below).

Call the action

Add Microsoft Dataverse > Perform an unbound action and choose Action Name = sharpxrm_PersonnatorCheck. Add the inputs from Advanced parameters.

Perform an unbound action configured for sharpxrm_PersonnatorCheck

Why does the designer say "Showing 3 of 94"? The Field Mapping input is a reference to a table row, so the designer lists every Field Mapping column. Only the ID field needs a value.

Input fields

Designer fieldRequiredWhat to enter
item/OperationYesType DoPersonator to validate the Target row. DoAddOptionalMapping is an administrative operation used by the Field Mapping form to generate the list of optional Additional Mappings, and its Target must be a Field Mapping row. Do not use it for address validation.
item/TargetYesA JSON object that identifies the row to validate: its table type and its ID. For a contact:
{ "@@odata.type": "Microsoft.Dynamics.CRM.contact", "contactid": "<Contact ID>" }
For an account, use Microsoft.Dynamics.CRM.account and accountid. For a custom table, use Microsoft.Dynamics.CRM.<logical name> and <logical name>id. Type the double @@: Power Automate treats a single @ as the start of an expression, and @@ is sent as a literal @odata.type at run time.
Sharpxrm_addressvalidationfieldsconfig
item/FieldMappingId/sharpxrm_addressvalidationfieldsconfigid
OptionalThe ID of the Field Mapping row to use. When it is empty, the action uses the Field Mapping for the Target's table whose API Configuration is Melissa Personator. The Field Mapping's Table Name must match the Target's table, otherwise the action fails. In the example: first(outputs('Get_Personator_field_mapping')?['body/value'])?['sharpxrm_addressvalidationfieldsconfigid'].

Output values

OutputDescription
OperationCompletionMessageSUCCESS when Melissa responded and the row was processed, or when the call was skipped because there was nothing to validate. FAILED when Melissa returned a transmission-level error. Use ValidationStatus to know whether the address was verified.
ValidationStatusVERIFIED: no error code was returned. PARTIAL: an error code was returned that is not in the Field Mapping's Melissa Blocking Result Codes, so the data was saved (for example a suite error). NOT_VERIFIED: a blocking code was returned, so only the Validation Details field was updated. SKIPPED: the row has no street address and no postal code, so Melissa was not called and no credit was used.
RecordResultCodesRecord-level result codes returned by Melissa, for example AE08,AS02,AS17,VS00.
RecordUpdatedtrue when the action wrote values to the row.
MelissaResultCodes, MelissaResultCodeDescriptionsMelissaResultCodes is filled only when the operation FAILED and contains Melissa's transmission error codes. MelissaResultCodeDescriptions contains readable descriptions of the record-level codes, for example AE08: Suite (sub-premise) number invalid, or the transmission codes when the operation FAILED.

Where are the address result codes? Record-level codes such as AS01 or GS05 are returned in RecordResultCodes. They are also written to the Field Mapping's Validation Details field (in the example, the contact's Validation Result column).

Report or react to the result

The example Validation summary compose reads the action outputs and the stored result codes:

Compose action that summarizes the Personator result

  • addressVerified = equals(outputs('Validate_with_Melissa_Personator')?['body/ValidationStatus'], 'VERIFIED'), or contains(resultCodes, 'AS01') for fully verified addresses only
  • rooftopGeocode = contains(resultCodes, 'GS05')

Common Melissa Personator codes:

CodeMeaning
AS01Address fully verified against postal data (deliverable).
GS05Geocoded to rooftop level.
AE..Address errors, for example AE02 (unknown street).
AC..Address changes that Melissa made to the input.

For the full list, see the Melissa result code reference on wiki.melissadata.com.

Behavior to be aware of: when Melissa returns a code listed in the Field Mapping's Melissa Blocking Result Codes (by default any AE, PE, EE or NE code, or SP01), the action only updates the Validation Details field and returns ValidationStatus = NOT_VERIFIED. Other error codes are saved with the data and return PARTIAL. To keep building-level data such as county, ZIP+4 and coordinates when only the suite is wrong, remove AE08 and AE09 from the list. Use ValidationStatus to notify users or create a follow-up task.

Expected results

  • 1600 amphitheatre pkwy, mountain view, CA, USA: SUCCESS, the contact is updated to 1600 Amphitheatre Pkwy, Mountain View, CA 94043-1351, United States of America, with coordinates. Codes AC01,AS01,AS17,GS05,VS00, so addressVerified and rooftopGeocode are both true.
  • Main Street, Toronto: SUCCESS, ValidationStatus = NOT_VERIFIED, codes AC01,AE02,GE01. The address is not changed and both flags are false.
  • 9645 Gerwig Ln Ste 200, Columbia, MD 21046 with AE08 and AE09 removed from the blocking list: SUCCESS, ValidationStatus = PARTIAL, codes AE08,AS02,AS17,VS00. County, ZIP+4 and coordinates are saved.
  • A contact without an address: SUCCESS, ValidationStatus = SKIPPED. Melissa is not called.

Troubleshooting

MessageWhat to check
PCE01-01: Unable to find a corresponding Field Mapping to process this request.No active Field Mapping for the Target's table with a Melissa Personator API Configuration.
PCE01-02: The Api Configuration related to the provided Field Mapping is not valid for this operation.The Field Mapping you passed is for another table, or its API Configuration is not Melissa Personator.
PCE02-01: We did not find a valid licence to perform this operation.Check the Address Validation license.
Exception occured when contacting melissa data. HttpCode …Check the Melissa license key on the API Configuration and its credits.
Template error mentioning odata.type when saving the flowThe Target uses a single @. Use @@odata.type.

Was this article helpful?