Ask File
Overview
The Ask File action prompts users to upload a specific type of media file through WhatsApp. This action is essential for scenarios where users need to provide documentation or media files, such as images, videos, or audio clips. You can configure error handling, validate responses, and store the file URL in a bot variable for future use.
Step-by-Step Instructions
Compose Your Message:
Enter the message that will prompt the user to upload a file. The message can be up to 4096 characters.
You can format the message text to enhance user engagement:
Bold: Select text and click the "B" button to enclose it in double asterisks (
*).Italic: Highlight the text and click the "I" button to enclose it in underscores (
_).Strikethrough: Select text and click the "s" button to enclose it in tildes (
~).
Add emojis by clicking on the emoji icon to enhance the message.
Adding Variables:
Insert variables into the message by clicking on the "Add Variables" button. This helps customize the message with dynamic content, such as the user’s name or other data. Tip: Ensure the variable has the correct data for seamless integration into the message.
File Type (Optional):
Specify the allowed file types for upload. Users can upload files in the following formats:
Image
Video
Audio
Document
Error Handling:
Error Attempt: Define the number of allowed attempts for the user to upload a valid file. If the user uploads anything other than the specified file type (e.g., text or numbers), this setting defines how many wrong inputs are permitted before triggering an error.
Error Message: Create an error message to notify the user when they have provided an invalid file. For example, "Please upload a valid file (image, video, audio, or document)."
Action on Invalid Input:
End the Flow: If the user exceeds the allowed number of invalid attempts, the bot will stop the flow, and no further actions will be triggered.
Fall Back Flow: Define an alternative flow if the user fails to upload a valid file after several attempts. This helps recover from errors and continue user engagement.
Skip the Question: If the user cannot provide a valid file, the bot will skip this action and continue with the next one.
Store Response in a Variable (Optional):
You can save the uploaded file's URL by selecting a bot variable from the dropdown list. The file URL will be stored in this variable for future use in the flow. Example: Store the file in a variable like
FileData, which can be accessed later in the flow.
Sample Output
{
"FileData": "https://url.com/sample.pdf"
}Examples
File Upload Request: "Please upload the required document (e.g., receipt, identification) in the allowed format."
Image Upload: "To proceed, kindly send an image file related to your query."
FAQs
What types of files can users upload?
Users can upload images, videos, audio files, and documents based on the specified settings.
What happens if the user uploads an invalid file?
If the user uploads an invalid file type, the bot will follow the error handling process, which may include retry attempts, fallback actions, or skipping the question.
Troubleshooting Tips
Invalid File Types: Ensure the message clearly states the allowed file formats to avoid confusion.
Too Many Invalid Attempts: Adjust the error attempt settings if users consistently fail to upload a valid file.
Last updated