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

Mogli Number Flow - Mobile or Phone

  • Dark
    Light

Article summary

Mogli Number Flow from Mobile or Phone

Use the flow below as a guide for populating the Mogli Number. 

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 Mobile and Phone fields, with Mobile as priority.

Goal

NEW A:

Mogli Number generated from Mobile if present.

NEW B:

Mogli Number generated from Phone if Mobile is blank.

UPDATE A:

If Mobile is present and Mogli Number is blank, generate from Mobile.

UPDATE B:

If Mobile is present and Mobile changed, generate from Mobile.

UPDATE C:

If Mobile is blank and Mogli Number is blank, generate from Phone.

UPDATE D:

If Mobile is blank, and Mobile or Phone is changed, generate from Phone.

Overview

Conditions

Formula
From the Resources Tab create:

OR(

AND(

ISBLANK({!$Record.Mogli_SMS__Mogli_Number__c}),

OR(

NOT(ISBLANK({!$Record.MobilePhone})),

NOT(ISBLANK({!$Record.Phone}))

)

),

ISCHANGED({!$Record.MobilePhone}),

ISCHANGED({!$Record.Phone})

)

Decision

Decision

Assignment

Assignment

fMobileMogliNumber 

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

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

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

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

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",""),"+",""),"(",""),")","")," ",""),"-",""),",",""),".","")))

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 and/or fMobileMogliNumber formulas to reference the country code instead of +1. Follow all other steps as listed above.

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

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

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




Was this article helpful?