Views:

Overview

In this article we show how to copy address details from Account to Contacts by executing a Formula via a Power Automate Flow using a Custom Connector. It is a simple scenario to demonstrate the interoperability of Power Automate Flow and North52 Formulas via a Custom Connector - there are far more powerful/complex scenario this could be used for! 

This article assumes that you have installed the North52 Execute Formula Customer Connector - see this article for details.

Basic Flow Outline

  1. From an Account record user manually triggers the Flow
  2. Account details are retrieved (address details)
  3. All associated Contacts are retrieved
  4. For each Contact the Execute Formula Custom Connector is run, passing in the Account address details

Set up Formula and Flow

Formula

The Formula runs in the context of a Contact as that will be the record that is updated.

  • Open the North52 App
  • Navigate to Business Process Activities > Formulas
  • Create a new formula, setting the following values in the Formula Guide:
    • Source Entity set to Contact
    • Set Formula Type to Library Calculation
    • Select the Decision Table editor
  • Change the Name of the formula to Library Calculation - Sync Address Details to Contact from Account
  • Click Save

Decision Table Setup

Setup columns for fields that need to be updated:

  • Select columns C to H
    • Right-click and select Insert > Insert Action
  • Select cell B2
    • From the Source tab, expand Source and find and click on Address 1: Street 1
  • Select cell C2
    • Click on Address 1: Street 2
  • Select cell D2
    • Click on Address 1: Street 3
  • Select cell E2
    • Click on Address 1: City
  • Select cell F2
    • Click on Address 1: State/Province
  • Select cell G2
    • Click on Address 1: ZIP/Postalcode
  • Select cell H2
    • Click on Address 1: Country

Add “virtual” fields that get passed into the custom connector. They are virtual as they do not actually exist, however the North52 parses them from the incoming request.

  • Select cell B4
    • Enter [contact.flow_address1_line1]
  • Select cell C4
    • Enter [contact.flow_address1_line2]
  • Select cell D4
    • Enter [contact.flow_address1_line3]
  • Select cell E4
    • Enter [contact.flow_address1_city]
  • Select cell F4
    • Enter [contact.flow_address1_stateorprovince]
  • Select cell G4
    • Enter [contact.flow_address1_postalcode]
  • Select cell H4
    • Enter [contact.flow_address1_country]
  • Click Save

The Formula is now ready. Take note of the Formula Short Code as we need that for the Flow.
 

Flow

  • Navigate to https://make.powerautomate.com/
  • Create a new Instant Cloud Flow
    • Name the flow Sync Address with Contacts
    • Select the option When a row is selected (Microsoft Dataverse)
    • Click Create
  • Click on the When a row is Selected action
    • Select the Accounts table (you may need to create a connection and sign in first)
  • Click the + icon to add a new action
    • Select the Dataverse Get a row by ID action
    • Rename to Get a row by ID - Account
    • For Table name select Accounts
    • For Row ID select Account (unique identifier of the Account)
  • Click the + icon to add a new action
    • Select the Dataverse List rows action
    • Rename to List rows - Contacts for Account
    • For Table name select Accounts
    • For Selected columns enter contactid
    • For Filter rows enter _parentcustomerid_value eq Account (unique identifier of the Account)
  • Click the + icon to add a new action
    • Select the Apply to each action
    • Rename Apply to each Contact
    • For Select an output from previous steps select body/value (list of items)
  • Click the + icon within the Apply to each to add a new action
    • Select the Custom actions filter
    • Select Execute Formula (should have North52 logo beside it)
    • You will need to sign in to create a connector reference
    • Rename to Execute Formula - hlD (using the short code of your Formula)
    • For Filter enter (replace hlD with your short code, and anything in [ ] need to be referenced using the tool to enter data from previous steps):
      north52_name eq 'hlD' and north52_parameters eq '<contact><flow_address1_line1>[address1_line1]</flow_address1_line1><flow_address1_line2>[address1_line2]</flow_address1_line2><flow_address1_line3>[address1_line3]</flow_address1_line3><flow_address1_city>[address1_city]</flow_address1_city><flow_address1_stateorprovince>[address1_stateorprovince]</flow_address1_stateorprovince><flow_address1_postalcode>[address1_postalcode']</flow_address1_postalcode><flow_address1_country>[address1_country]</flow_address1_country></contact>' and north52_targetentityid eq '[contactid]' and north52_formulatype eq ‘99’
  • Click Save

Test

Go to an Account record with Contacts and run the flow.