Steps
Number
Ask for a number, phone, ID, amount, percent or code, check it against your rules, and save a clean value.
What it does#
Number asks a question and waits for a number that fits your rules: a number of guests, a budget, a phone number, an Israeli ID, an order code. If the answer doesn't fit, the customer gets a clear message and is asked again. A valid answer is saved in a clean form, ready for later steps.
Add a Number step#
- 1
Drag Number onto the canvas
It's under Flow in the Steps panel on the left. Click it to open Step settings.
- 2
Name the step and write the question
Rename the step at the top of the panel (it starts as
number1), for exampleguests. Use letters and numbers only. Under Message, write the question. - 3
Choose the format
Under Format, pick a Number type. The default is Whole number.
- 4
Set the rules (optional)
Under Rules, set a Minimum and Maximum, the Number of digits, or the Digits after the decimal point. Leave a field empty for no limit.
- 5
Check the messages
Under Messages, each rule has the message customers get when they break it. Leave a field empty to use the default shown in grey.
- 6
Choose what happens after wrong answers
Under Output, After invalid answers is Keep asking by default. Choose 1, 2 or 3 to add a Not valid output, and connect it.
- 7
Try it
Under Try it, type sample answers, one per line. Each shows whether it's accepted and what is saved, using the same check as the bot.
Number types#
| Number type | Accepts | Saved as |
|---|---|---|
| Whole number | Digits, with or without thousands separators: 42, 1,250 | 1250 |
| Decimal | A number with an optional decimal part: 12.5, 1,234.56 | The number |
| Phone number | Israeli local numbers (050-1234567) and numbers with a country code (+44 20 7946 0958) | +972501234567 or 0501234567, your choice under Save as |
| Israeli ID | 9 digits with a valid check digit. Shorter numbers are padded with leading zeros. | The 9 digits |
| Amount / price | A price, with an optional currency symbol: ₪1,250.50, $99 | A plain number: 1250.50 |
| Percent | With or without %: 15%, 7.5 | The number of percent: 15 |
| Custom pattern | Your own format, for codes and IDs | The code in your format |
Decimal separator (for whole numbers, decimals, amounts and percents): Auto reads both 1,234.5 and 1.234,5; when it can't tell, a comma separates thousands. Choose 1,234.5 or 1.234,5 to force one style.
Phone number also has Accepted numbers: Israel and international, or Israeli only.
Custom pattern has two modes. Simple: # is a digit, A is a letter, * is either; for example ###-####### accepts 050-1234567. Separators such as - are optional in the answer and are put back. Advanced (regex): a regular expression the whole answer must match, up to 200 characters.
Words such as twenty are not turned into numbers.
Rules#
| Rule | For | What it does |
|---|---|---|
| Minimum / Maximum | Whole number, Decimal, Amount, Percent | The lowest and highest accepted value. A new Percent step starts at 0 to 100. |
| Number of digits | Whole number, Decimal | Range (At least / At most) or Exactly. Counts the digits before the decimal point. |
| Digits after the decimal point | Decimal, Amount, Percent | The most digits after the point. A new Amount step starts at 2. |
| Allow negative numbers | Whole number, Decimal, Amount | Off by default: -5 is rejected. |
Example#
A restaurant takes bookings for 1 to 12 guests:
Name: guests
Message: How many guests, {{@fullName}}?
Number type: Whole number
Minimum: 1 Maximum: 12
Out of range message: For more than 12 guests, please call us at 03-1234567.| The customer sends | They get |
|---|---|
| 4 | Accepted. {{@guests}} is 4 and the next step runs. |
| four | Please send a whole number, e.g. 42. |
| 20 | For more than 12 guests, please call us at 03-1234567. |
It works the same on WhatsApp and on your website.
Messages#
Each rule has its own message: Not readable, Out of range, Wrong number of digits and Too many decimals. Empty fields send a default in your bot's language, for example Please send a number between {min} and {max}. Messages can be up to 500 characters.
You can use {min}, {max}, {minDigits}, {maxDigits}, {decimals} and {example} in your messages. They're filled in for the customer, so Please send a number between {min} and {max}. arrives as Please send a number between 1 and 12.
Use the answer#
| Write | Holds | Example |
|---|---|---|
{{@guests}} | The clean answer | 1250 |
{{@guests_raw}} | The answer exactly as typed | 1,250 |
Use the clean answer in messages, conditions and HTTP steps. Use the raw answer when you want to show the customer exactly what they wrote.
After invalid answers#
- Keep asking (default): the customer gets the message and is asked again until the answer fits.
- 1, 2 or 3: after that many invalid answers in a row, the chat continues on the Not valid output. The step then has two outputs on the canvas: Valid and Not valid. Connect Not valid to, for example, a message with your phone number. If Not valid isn't connected, the bot keeps asking.
Customers can always type back to return to the previous question.
Steps made with the original check#
Number steps added before the new check keep working as they always did: they also turn words such as twenty or 3k into numbers. Their settings show Upgrade to the new number check.
- 1
Click Upgrade to the new number check
Under What changes you see the differences and a table of sample answers: how each is handled Now and After upgrade.
- 2
Upgrade or keep it
Click Upgrade, or Keep the original. Nothing changes for customers until you publish, and Undo returns the original check.
Common mistakes#
- "This step isn't ready yet". Connect a step into this one and connect it to the next step, and fix any problem shown in red in the settings, such as The minimum is larger than the maximum.
- Phone numbers as Whole number.
050-1234567is rejected as a whole number. Use Phone number, which also saves it in one clean format. - Prices rejected.
99.90is not a whole number. Use Amount / price (or Decimal). - A Not valid output that goes nowhere. Connect it, or switch back to Keep asking.