Text

Random and themed text, lists, templates, regular expressions and masks. See all field types and the options every field takes.

text

Text of a given category: words and sentences, or localized themed values such as names, companies and cities.

Parameter Values Default Description
category text category words What to generate.
minWords integer 1 Minimum word count for word-based categories.
maxWords integer minWords + 3 Maximum word count for word-based categories.
values list Pick from these values instead of generating text.
weights map Relative weight per value, e.g. { active: 8, blocked: 1 }. Values without a weight count as 1.

Also takes the common options and textual constraints.

text.yaml
- { name: city, type: text, category: city }

enum

A value picked from your list, optionally weighted.

Parameter Values Default Description
values list The values to pick from, without duplicates. Exactly one of values or sourceFile is required.
weights map Relative weight per value, e.g. { active: 8, blocked: 1 }. Values without a weight count as 1.
sourceFile text A built-in list instead of values: builtin:colors or builtin:eye-colors.

Also takes the common options and textual constraints.

enum.yaml
- { name: status, type: enum, values: [pending, active, blocked] }

template

Text assembled from earlier fields of the same record.

Parameter Values Default Description
template text Required. Text with {{field}} placeholders naming earlier fields in the same scope.

Also takes the common options and textual constraints.

template.yaml
- { name: first, type: text, category: firstName }
- { name: last, type: text, category: lastName }
- { name: label, type: template, template: "{{last}}, {{first}}" }

regexp

Text matching a regular expression.

Parameter Values Default Description
pattern text Required. The expression. Supports literals, classes such as [A-Z0-9], alternation (a|b) and the quantifiers ?, *, +, {n}, {min,max}. Lookaround and backreferences are rejected.
maxAttempts integer 100 Attempts per value to satisfy the textual constraints before the job fails.

Also takes the common options and textual constraints.

regexp.yaml
- { name: invoice, type: regexp, pattern: "INV-[0-9]{6}" }

pattern

Text from a placeholder mask: ? becomes a letter and # a digit.

Parameter Values Default Description
pattern text Required. The mask, e.g. ??-####.
mode lexify, numerify, lexifyNumerify lexifyNumerify Which placeholders to replace: lexify (?), numerify (#) or both.

Also takes the common options and textual constraints.

pattern.yaml
- { name: plate, type: pattern, pattern: "???-####" }