Custom Template replace slash '/' with dash '-' in telephone number

Status
Not open for further replies.

autohaus

Customer
Joined
Aug 17, 2018
Messages
85
Reaction score
22
Hi All,
I've created a custom CRM template for our ERP system. It uses a REST matching scenario and gets an XML result. Looking for 123456789 will find contacts in our ERP with separators blank " ", dash "-" or slash "/" in phone numbers like "123 4567 89", "1234-56789" or "12334/56789". Parsing works fine and output variables get filled, but a 3CX CRM contact is only created if there isn't a slash '/' in the XML answer. 3CX doesn't accept a phone output variable with a "/".

Unfortunally a lot of our customer records have phone numbers with a slash '/' as divider between area code and local number, e.g. "01235/6789". I've tried to replace this slash '/' with a dash '-', but without success.

I'v tried somthing like this in several variations, but couldn't get rid of "/":
Code:
...
      <Variable Name="MOBILE">RESULT.RESPONSE.DATA.BUSINESS_PARTNER.CONTACT.CONTACT</Variable>
...
      <Output Type="PhoneMobile" Passes="0" Value="[[MOBILE].Replace('/','-')]" />

Template generator throws no error. CRM test shows: "Variable MOBILE set to 01235/6789". No replacing is done.

Is it possible to use a replacing method in a matching scenario?

Thank you
Sven
 
Last edited:
Hello Sven,

Just tested the following expression and works:
<Output Type="PhoneMobile" Value="[[MOBILE].Replace(&quot;/&quot;,&quot;-&quot;)]" />
 
  • Like
Reactions: autohaus
Hello edossantos,
thank you for your answer.Our CRM integration is working now. Perhaps I had a typo during my tests.
 
  • Like
Reactions: edossantos
Status
Not open for further replies.