How to Save Data from Scenario to Custom Data?
Saving data from a scenario allows automatically saving user responses to a Custom Data table. This allows accumulating data about user interactions and using it for further analysis or automation.
When Needed
- You need to save user responses for further analysis.
- You need to accumulate data about client interactions.
- You need to automatically record information that the user enters in the bot.
What's Important to Know
- Saving to Custom Data — option in "Wait for Response" and "Message with Keyboard" components.
- Saving happens not immediately, but after executing an action in the scenario.
- You need to previously create a Custom Data model with corresponding fields.
- Data is saved automatically after the user goes through the corresponding block.
Prerequisites
You are logged in with integrator or administrator rights. There is a created Custom Data model with needed fields in the system. You have access to the scenario constructor.
Step-by-Step Instructions
- Go to the bot's scenario constructor.
- Open the "Wait for Response" or "Message with Keyboard" component from which you need to save data.
- In component settings, find the "Save to Custom Data" option.
- Enable the "Save to Custom Data" option.
- Select the table (model) to save data to from the list of available models.
- Specify the column (field) where to write the user's response.
- Save changes in the component and scenario.
⚠️ Important: Saving happens not immediately, but after executing an action in the scenario. Make sure there is an action after the block with saving that will be executed.
What Happens After
After the user goes through the block with the enabled "Save to Custom Data" option, their response is automatically saved to the specified table and column. Data becomes available for viewing in the Custom Data module and can be used in other parts of the system.
How to Verify It Worked
- Check that the "Save to Custom Data" option is enabled in the component.
- Make sure the correct table and column are selected.
- Test the scenario by entering a test response and check that data is saved in Custom Data.