Pebble is a lightweight template and formatting language used in Webex Contact Center to set variable values, evaluate conditions, and format strings inside the Flow Designer

Here are some examples that may be useful:

If an incoming ANI arrives formatted as 15128540000 (11 digits), but your database only stores 10-digit local numbers (5128540000), use slice to strip the first character.

{{ NewContact.ANI | replace({"+": ""}) | slice(1) }}

If your API strictly requires full E.164 format with a leading 1, but the trunk passes a 10-digit number, use the tilde (~) operator to prepend string values.

{{ "1" ~ (NewContact.ANI | replace({"+": ""})) }}

If a caller hides their caller ID (Anonymous/Unavailable) or an API field returns null, trying to run string filters can crash the node. The default() filter ensures your flow keeps moving without throwing an execution error.

{{ NewContact.ANI | default("UNKNOWN") }}

If you need to strip both spaces and dashes from phone numbers entered by users or returned by legacy systems, pass multiple key-value pairs inside the single map argument:

{{ var_RawInput | replace({"-": "", " ": "", "(": "", ")": ""}) }}

When querying APIs by email address, user ID, or account codes, case sensitivity can prevent exact matches.

{{ var_UserInput | lower }}
{{ var_StateCode | upper }}

PSTN headers or DTMF collection nodes often store extra trailing or leading spaces.

{{ var_AccountNum | trim }}

Leave a Reply

Related Post