AnsweredAssumed Answered

Phone Number Format Webhook

Question asked by 102ab804232b1e12e84d988f4a2f35d76f2b6b88 on Dec 28, 2016
Latest reply on Dec 29, 2016 by 102ab804232b1e12e84d988f4a2f35d76f2b6b88

**** Marketo community,


I'm trying to format phone number field values for existing records (can't rely on Mask Input within Marketo Forms prior to Lead creation) by calling the following webhooks with support from Hoosh Marketing's (launchpoint partner) free Excel for Marketo webhook solution. Feel free to suggest an alternative approach if these webhooks or webhooks in general are not the best approach.


The first webhook below works successfully, but the second one fails. See the Response "Disallowed Key Characters".


1) Clean Phone Number: remove non-numeric charcters from the field value.

  • Sample Record Phone Number field value (pre-webhook being called): +12111123456
  • Webhook Payload Template:=text(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE("{{lead.Phone Number}}"," ",""),"-",""),"%2B1",""),"%29",""),"%28",""),"*",""),".",""),"+",""),"(",""),")",""),"%",""),"2B",""),"0")
  • Payload: =text(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE("%2B12111123456"," ",""),"-",""),"%2B1",""),"%29",""),"%28",""),"*",""),".",""),"+",""),"(",""),")",""),"%",""),"2B",""),"0")
  • Response: {"result":"2111123456"}


2) Format Phone Number: (XXX) XXX-XXXX

  • Sample Record Phone Number field value (pre-webhook being called): 2111123456
  • Webhook Payload Template: ="("&LEFT("2111123456",3)&") "&MID("2111123456",4,3)&"-"&MID("2111123456",7,4)
  • Response: Disallowed Key Characters LEFT("2111123456",3)