Reset Slots

I have a form.

image

And I am using custom actions to get the last 2 entities.( i.e user_sub, user_plan )

image

When I use action_restart those variables which were filled thru custom actions (i.e user_sub, user_plan) aren’t getting reset why ? Does anyone know why this happens?

Do you mean to use action_restart?

1 Like

yeah I mean action_restart .

actually /restart is also not clearing those two slots . I m not sure why

What I’d actually rather do is implement my own restart action in which I make sure all slot values are set to None

Format is

Return(SlotSet(entity,None))

We shld do this , For all variables?

Yes but of course no need to write all slots one by one.

return [SlotSet(slot, None) for slot in slots]

slot is a list of slots, you can even get it from the domain variable. Do print(domain) to see its structure and discover how to get the slot list from it :slight_smile:

1 Like

Thnx @ChrisRahme . It worked But

image

I faced issues when i used for slot in slots . it says slots is not defined as its in actions server . so i manually created a list . is there any other way

Of course slots should be defined. I mentioned above what the alternative is.

Either write them all (still better that writing them all with “SlotSet”) or get it from the domain dictionary which is defined in custom actions.

Do print(domain), it will appear in the action server’s logs. See its structure and if you know basic Python, you will know how to extract the slots from it.

1 Like

Thanks @ChrisRahme It really Helped !! :slight_smile: :slight_smile:

1 Like

Awesome :slight_smile: