What is a number block?
A number block allows you to ask questions and receive answers in the form of numbers. For example, if a customer has questions about their order and needs to provide an order ID, a number block can be incorporated into the conversational flow. The number block also ensures that the user's input is validated as a number.
Why use a number block?
Number blocks can be used to receive answers from the user in numerical form.
This GC block provides two types of number formats:
- Integer: This type can be used to receive numerical input from the user, specifically whole numbers (integers). It ensures that the user's input is validated to be an integer, preventing non-numeric and decimal entries.
For example, a company is conducting a survey and wants to collect the age of the participants using a chatbot. The chatbot uses this type of number block to ensure that the age entered is a valid whole number.
- Decimal: This type can be used to receive numerical input from the user, specifically numbers that can include decimal points. It ensures that the input is validated to be a valid decimal number.
For example, a fitness program chatbot needs to collect the user's weight to customize a fitness plan for them. The chatbot uses this type of number block to allow users to input their weight with decimal precision.
The number block cannot exceed the 1000-character limit. Steps to create a number block
1. To add the Number block to the flow, click on the add block icon (+).
2. Choose Number under the Question Cards section.
If you try to close the block listing without saving the number block, all the unsaved changes will be lost permanently.
3. Add the Question in the question field.
If you enter the name of an existing block for another block, the below error will be displayed. 4. Choose the Number Format you want your user to input, either an Integer or a Decimal.
5. Add a unique name for the block in the Block name field.
6. The Input variable will auto-populate according to the added block name. You can change it if needed.
7. Adjust the existing Validation Error Message to fit the context of your number block.
8. Click on the Preview block option to see how the block would be displayed to the user.
9. If you are satisfied with the output, click Save.
- If this block is not mandatory for your user to answer, toggle on the option to Skip Block. This option is not available for flows of WhatsApp, Telegram, and Facebook Messenger channels.
- If you want to keep this block as the end of your conversational flow, toggle on the End block option.
Editing the number block
You can edit a number block whenever required, even after the flow is published or in the drafts section, by following these steps:
1. Open the flow and click Edit.
2. Click the Number Block, which you may have named differently.
3. Choose Edit Block from the displayed options.
4. Make the required changes to the block and click Save.
5. Click Save.
6. Publish the flow.
- If you edit a block while an end user is engaged in a live session with the bot, the previous version of the flow will be rendered until they restart the conversation.
- After making changes, it is necessary to re-publish the flow for those changes to be reflected in an end user's session.
- If a change is made to an input variable, it will be automatically updated across all flows where the variable is used.
Copy a number block
The Copy Block option can be used when you need to reuse a block that you previously created; you can copy that block and add it to your flow as it is, or edit as needed.
1. Click the Number Block you require to copy.
2. Choose the Copy Block option. The block will be pasted on the clipboard.
3. When you need to paste that block, click the Add block icon (+).
The pasted block would appear on the block listing section and be stated as From Clipboard. 4. Edit the block if required. or simply click Paste.
- The copied number block can be pasted multiple times. If you no longer need to paste it, you can clear the clipboard by clicking the close icon corresponding to the clipboard option.
- When copying an existing number block, all of its content, including variables, if any, will be copied as is. You can edit it as needed before adding it to the flow. As the names of each block must be unique, the word '_copy' will be added to the copied blocks automatically. This can be changed if required.
- If you have copied a block and it is in the clipboard, deleting the copied block later will also remove it from the clipboard.
Deleting the number block
1. Open the flow and click Edit.
2. Click the Number Block, which you may have named differently.
3. You will see a set of block options from which, click on Delete Block.
4. Confirm deleting the selected block by clicking Yes, Delete it.
You can use the undo option to restore a deleted block as your following action, but not otherwise.
5. Click Save.
6. Publish the flow.
- If you delete a block while an end user is engaged in a live session with the bot, the previous version of the flow will be rendered until they restart the conversation.
- After making changes, you need to republish the flow for those changes to be reflected in an end user's session.
If the deleted block has dependencies, such as given below, errors will be displayed.
Path below the block:
If the block was used to jump to a different flow:
Use Case
A customer received their order but was facing an issue with their gadget. They immediately check their website and start a conversation with the bot. In the process of getting the damaged gadget validated, the bot asks for the gadget's IMEI number.
Examples of number block in a flow
Validating
To validate the issue, the team at Zylker electronics requires the IMEI number of the mobile phone.
Bot prompt: To help us validate the issue could you please provide the IMEI number of the gadget?
Please note: This number is usually found on the device itself or packaging.
Input given in the builder:
GC widget's Output:
After the user adds the IMEI number:
Best practices
- Specify the expected format if necessary, such as "Enter your phone number without any dashes or spaces."
- Clearly explain what numerical input is needed and why. For example, "Please enter your 10-digit order ID number."
- Confirm receipt of the number once entered correctly. For example, "Thank you! We have received your order ID."
- Inform users about how their numerical data will be used and protected.
- Define any constraints for the numerical input, such as minimum and maximum length. For example, "Enter a 16-digit registration number."
Supported channels
The number block is supported in the following channels:
- WhatsApp
- Telegram
- Facebook Messenger
- LINE
- Instagram
- Business Messaging
A total of 500 blocks can be added in a flow. If you reach that count, you can use the jump block to create a new flow or delete unnecessary flows.