Views:

Scenario Overview

In this scenario we will show you how to create an email address from a contact's name and their parent account'swebsite URL using regular expressions.

We have a batch of records that contain only the first name and the surname of the contact but they have a parent accountWe will extract the domain name for the email addresses from the parent account's website field and then add them to the first name and last name.

Processing Steps

In this example we are using http://www.adatum.com/ website URL.

  1. First we remove 'www.' from the website URL if it exists using Replace() function
  2. Next we remove the http:// or https:// if they are on the URL using RegexReplace()
  3. Finally we remove any trailing forward slashes etc. again using RegexReplace()

Start: http://www.adatum.com/ After the Replace() function: http://adatum.com/ After the first RegexReplace() function: adatum.com/ After the second RegexReplace() function: adatum.com

North52 Decision Suite Solution

The North52 Decision Suite solution works like this,

  • Formula of type 'Save - To Current Record' is created on the Contact entity
  • Source Property is set to 'Firstname, Lastname' and 'Account Name'
  • The Target Property is set to 'Email'

North52 Decision Suite Steps

The following set of steps outline how to create this Formula

  • Create a formula of type 'Save - To Current Record' on the Contact entity
  • Set the Source Properties as 'First Name, Last Name' and 'Account'
  • Set the Target Property as 'Email'
  • Copy and paste the formula below into the formula canvas
  • Save and test!

Formula

if(ContainsData([contact.firstname], [contact.lastname], [contact.parentcustomerid.websiteurl.?]) and
   DoesNotContainData([contact.emailaddress1]),

  /* True */
  [contact.firstname] + '.' + [contact.lastname] + '@' +
  
  RegexReplace(
    RegexReplace(
      Replace([contact.parentcustomerid.websiteurl.?], 'www.', ''), /* 1 - remove the www. */
      «^.*:\/\/», ''),                        /* 2 - remove the http:// or https:// */
    «\/.*», '')                           /* 3 - remove any trailing /etc after the domain name */
  
  /* False */
  ,'NoOp'
)

Wizard - DoesNotContainData

Please see below the wizard you can use to create the DoesNotContainData() function call used in this formula. 

Note you will need to either type or paste in the following. 
 

 

Did you know?

North52's Decision Suite can help enhance Dynamics Business Process Flows

Sometimes business processes are more complicated and have significant permutations that are not easily managed with the out-of-the-box Business Process Flow (BPF) functionality. With North52 Decision Tables you can create rule dependent task checklists for each BPF stage and not allow users to progress until your rule criteria has been met. 

Learn how we do it in this knowledge base article