Mogli Number Flow - Single Phone Field
  • 26 Jul 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Mogli Number Flow - Single Phone Field

  • Dark
    Light

Article summary

Mogli Number Flow from Single Phone Field

Use the flow below as a guide for populating the Mogli Number from a single phone number field, such as "Phone". 

NOTE: Before activating this flow for Contact or Lead, please ensure that the Workflow Rules included in the Mogli package are deactivated. Failure to deactivate theseWorkflow Rules can result in the two automations conflicting with each other and preventing accurate updates to the Mogli number.

Description

Populate the Mogli Number field based on the Phone field.

Overview

Conditions

fPhoneMogliNumber 

From the Resources Tab create: Formula > Text Variable (United States Number Only - See International Section for International Number instructions)

IF(ISBLANK(TRIM({!$Record.Phone})),"",

IF(REGEX(TRIM({!$Record.Phone}),"[\\s\\S\\w\\W]*[a-zA-Z@#$%^&*<>!?\\[\\]_{};:'/~`]+[\\s\\S\\w\\W]*"),"",

"+1" & SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE(("+"& TRIM({!$Record.Phone})),"++1",""),"+1",""),"+",""),"(",""),")","")," ",""),"-",""),",",""),".","")))


vMogliNumber 

From the Resources Tab create: Create a text variable (vMogliNumber) and assign the default value of fPhoneMogliNumber

Update



Sending Texts Internationally?

International texting is available on Elite and Enterprise plans only. For more information on our WhatsApp functionality, see our WHATSAPP section.


You’re going to need to customize the Mogli Number flow to insert the proper country code based on the location of your recipient instead of "+1". 

First, create a custom formula field to determine the country code based on a selected country on the record. For a list of country codes, reference Populating Country Codes.

Next, revise the fPhoneMogliNumber formula to reference the country code instead of +1. Follow all other steps as listed above.

IF(ISBLANK(TRIM({!$Record.Phone})),"",

IF(REGEX(TRIM({!$Record.Phone}),"[\\s\\S\\w\\W]*[a-zA-Z@#$%^&*<>!?\\[\\]_{};:'/~`]+[\\s\\S\\w\\W]*"),"",

"+" & {!fCountryCode} & SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE( SUBSTITUTE(("+"& TRIM({!$Record.Phone})),"++1",""),"+1",""),"+",""),"(",""),")","")," ",""),"-",""),",",""),".","")))



Was this article helpful?