# Slot values are not getting set in custom action

**URL:** <https://forum.rasa.com/t/slot-values-are-not-getting-set-in-custom-action/4568>\
**Category:** Rasa Open Source\
**Created:** [January 22, 2019, 4:03pm UTC](https://forum.rasa.com/t/slot-values-are-not-getting-set-in-custom-action/4568 "2019-01-22T16:03:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pankhuri](https://avatars.discourse-cdn.com/v4/letter/p/58f4c7/32.png) [@pankhuri](https://forum.rasa.com/u/pankhuri)\
**Post date:** [January 22, 2019, 4:03pm UTC](https://forum.rasa.com/t/slot-values-are-not-getting-set-in-custom-action/4568/1 "2019-01-22T16:03:24Z")

</div>

Hi All, I am trying to set slot values of type text through my custom action but it is apparently not getting set when that action is run.

**Custom action snippet:**

class ActionCheckFilePublishName(Action): def name(self): # type: () -\> Text return “action\_check\_file\_publish\_name”

```
def run(self, dispatcher, tracker, domain): 
    mes = (tracker.latest_message)['text']
    if "ccla" in mes or "phe" in mes:
        SlotSet('file_publish_name_present','set')
        dispatcher.utter_template("utter_file_notpublished_1")
        return []
    else:
        SlotSet('file_publish_name_not_present','set')
        dispatcher.utter_message('Are you talking about PHE/CCLA file? yes/no')
        return []

```

class ActionFilePublishNextUtteranceMoodConfirm(Action): def name(self): # type: () -\> Text return “action\_file\_publish\_next\_utterance\_mood\_confirm”

```
def run(self, dispatcher, tracker, domain): 
    name_present = tracker.get_slot('file_publish_name_present')
    name_not_present = tracker.get_slot('file_publish_name_not_present')
    if name_present is not None:
        dispatcher.utter_template("utter_file_notpublished_2")
        return[]
    if name_not_present is not None:
        dispatcher.utter_template("utter_file_notpublished_1")
        return[]
    else:
        dispatcher.utter_message("Sorry, I didn't understand that!")
        return

```

**Slot snippet:**

slots: file\_publish\_name\_present: type: text file\_publish\_name\_not\_present: type: text

But still slot values are none. is there any other way of doing it or am i doing something wrong? Please help

---

<div class="post-metadata">

**Author:** ![Ghostvv](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ghostvv/32/211_2.png) [@Ghostvv](https://forum.rasa.com/u/Ghostvv)\
**Post date:** [January 22, 2019, 5:42pm UTC](https://forum.rasa.com/t/slot-values-are-not-getting-set-in-custom-action/4568/2 "2019-01-22T17:42:21Z")

</div>

if you want to set a slot with your custom action, it should `return [SlotSet(...)]`, please take a look at the example in docs: [Actions](https://rasa.com/docs/core/customactions/#custom-actions-written-in-python)

---

<div class="post-metadata">

**Author:** ![lcaraves](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/lcaraves/32/12211_2.png) [@lcaraves](https://forum.rasa.com/u/lcaraves)\
**Post date:** [December 30, 2020, 2:11pm UTC](https://forum.rasa.com/t/slot-values-are-not-getting-set-in-custom-action/4568/3 "2020-12-30T14:11:41Z")

</div>

Hi!

If want overwrite my slotset in custom action. How can you do it? Actually, i save my slotset in my custom action but then i can’t update my slotset in an action after.

Thank you, and I look forward to an excellent response.
