User Input Collection
Learn how to collect and handle user inputs during the placement flow
User Input Collection
Muta allows you to collect user inputs during the placement flow, including text inputs and multiple choice selections. These inputs are automatically collected and made available when the flow completes.
Example Usage
Input Types
Text Inputs
Multiple Choice
Event Structure
The user_input_final
event provides a comprehensive structure of all collected inputs:
Best Practices
-
Input Validation: Always check the
isRequired
flag for both text inputs and multiple choices to ensure you have all necessary data. -
Error Handling: Implement proper error handling for cases where required inputs are missing.
-
Data Processing: Process the collected inputs as soon as possible after receiving the
user_input_final
event to ensure a smooth user experience. -
Type Safety: Use TypeScript interfaces to ensure type safety when working with the input data.