Case scenario: The formatting of a telephone number is different on one side of a business card than the other.
E.g. The Swedish number is 08-123 45 45 and the international number is +46 8 123 45 45
We have made a VB script called StripCharacters that does this automatically if used in the forms template.
The variables used on the front page in our example template show the variables as stored in isave / typed in the form (with a lead zero and hyphenation marker)
The variables on page two are set up as a plain text variable with a VB Sctipt called StripCharacters.vbs and the function name StripCharacters.
Then connect it to the normal variable (phone, fax mobile etc) from page 1 and insert the character(s) you want to remove as a semicolon separated string as literate (e.g. “-;+”).
As literate 2 you can decide to remove the lead zero by typing 1 or 0 to keep it.
Parameterlist
1. Forms variable
2. Semicolon separated string with the characters you want to replace with a regular space (e.g. “-;+”)
3. If the leading zero is to be removed type “1”, if it is not to be removed type “0”
See screenshots and download the example template.
Use the Add Literal form/button to add parameter 2 and 3
Note that the only difference is the variable in parameter 1.
Hard code the +46 in the template or make a rule that sets the area code based on the group access. Note that the lead zero is stripped and the hyphenation marker is removed.
TIP! If you only want the dash to be stripped on the Swedish page of your BC and not the lead zero, type 0 as literate 3.
Download this alternate sample template to see this method in use.