Clear entitys values

I have a dialog, and in that dialog I have an entity, after using put your answer a confirmation is made, if the user answers no, he has to put the answer again, but he is not doing that he is simply in a loop . How do I delete what’s in the variable where the user’s output is stored?

Hello @joelgoncalves300

Welcome to the Kore community :wave:
To delete the value in an entity, you can add the following code to the script node:
delete context.entities.entityName . This will remove the value stored in the specified entity.

hi joel,
In this case when user answers no then he should direct to entity again, but it is not happening because the entity node has the value which is entered by the user so it is not again asking for the entity value. So for this you need to clear the entity value to again enter the entity value, for that you need to add bot action after the confirmation node where ‘no’ flow starts. In the bot action, add script node in which you need to add javascript code as follows to clear the entity values.

delete context.entities;

now connect the bot to the entity where you want to direct.

It solved my problem, thank you

1 Like