deep-jade•16mo ago
block to delete a variable
is there any way to let the user delete or modify an information that he/she has previously submitted through a flow ?
2 Replies
To allow users to delete or modify information they have previously submitted through a flow in Voiceflow, you can use the Set Step to change the value of a variable. Here’s how you can do it:
Deleting a Variable
Voiceflow does not support the direct deletion of variables during a flow. However, you can simulate the deletion by setting the variable to an empty value or a default state.
1. Add a Set Step: Drag a Set Step from the Logic section of the sidebar onto your canvas.
2. Configure the Set Step:
- Select the variable you want to "delete."
- Set its value to an empty string (
""
) or a default value (e.g., 0
for numeric variables).
Modifying a Variable
To modify a variable, you can use the Set Step to update its value based on user input or other conditions.
1. Capture User Input: Use a Capture Step to get the new value from the user.
2. Add a Set Step: Drag a Set Step onto your canvas.
3. Configure the Set Step:
- Select the variable you want to modify.
- Set its value to the new input captured from the user.
Example
Here’s a simple example to illustrate both deleting and modifying a variable:
1. Capture Step: Ask the user if they want to delete or modify their information.
2. Choice Step: Based on the user’s response, direct them to either a deletion or modification path.
3. Set Step for Deletion:
- Variable: user_info
- Value: ""
4. Set Step for Modification:
- Variable: user_info
- Value: {new_user_info}
(where new_user_info
is the variable capturing the new input from the user).
By following these steps, you can effectively manage user-submitted information within your Voiceflow project.You would just loop back through your question.