Skip to content

๐Ÿ“ž Phone Number Transformer โ€‹

The Phone Number transformer is used to generate either regular phone numbers or cell phone numbers.

๐Ÿ” Alternation โ€‹

This transformer does not mutate the existing row value โ€” it generates a new value.

โœ… Valid Data Types โ€‹

  • String

โš™๏ธ Options โ€‹

OptionTypeDescriptionDefault
cell-phoneBooleanWhether to generate a cell phone number instead of a regular phone number.false (not set)
formatStringSpecify a custom phone number format using # as a digit placeholder (e.g., 073#######).None

๐Ÿงช Examples โ€‹

Example 1: Default behavior โ€‹

toml
[[table.columns]]
name = "column-example"
transformer = "phone-number"
Output: "187-398-0023"

Example 2: Specifying cell-phone โ€‹

toml
[[table.columns]]
name = "column-example"
transformer = { "phone-number" = "cell-phone" }
Output: "(583) 479-0570"

Example 3: Specifying format โ€‹

toml
[[table.columns]]
name = "column-example"
transformer = { "phone-number" = { format = "073#######" } }
Output: "0730676396"

๐Ÿช„ Alias Support โ€‹

Instead of specifying transformer = "phone-number", you can also use the following alias to generate a cell phone number:

toml
[[table.columns]]
name = "column-example"
transformer = "cell-phone"