# Can I use slotset and dispacher.utter\_template in the same action

**URL:** <https://forum.rasa.com/t/can-i-use-slotset-and-dispacher-utter-template-in-the-same-action/1024>\
**Category:** Rasa Open Source\
**Created:** [September 11, 2018, 9:14am UTC](https://forum.rasa.com/t/can-i-use-slotset-and-dispacher-utter-template-in-the-same-action/1024 "2018-09-11T09:14:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sandy](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@Sandy](https://forum.rasa.com/u/Sandy)\
**Post date:** [September 11, 2018, 9:14am UTC](https://forum.rasa.com/t/can-i-use-slotset-and-dispacher-utter-template-in-the-same-action/1024/1 "2018-09-11T09:14:25Z")

</div>

Hi ,

I have the following action-

```auto
class ActionGrowthReport(Action):
   def name(self):
      # type: () -> Text
      return "action_growth_report"

   def run(self, dispatcher, tracker, domain):
      # type: (Dispatcher, DialogueStateTracker, Domain) -> List[Event]

      my_period = tracker.get_slot('period')
      my_bucket = tracker.get_slot('bucket')
      result = random.uniform(-0.3, 0.3) #eventually i will query the result from DB
      SlotSet("growth_amt", result if result is not None else [])
      if result > 0.0:
         dispatcher.utter_template("utter_growth_up", tracker, growth_amt=result, period=my_period)
      if result < 0.0:
         dispatcher.utter_template("utter_growth_down", tracker, growth_amt=result, period=my_period)
      # return [SlotSet("achieve_amt", result if result is not None else [])]
      return []

```

This works fine . As in the utter\_growth\_up/down is uttered with the the correct growth\_amt. But the slot growth\_amt doesn’t get filled even if I use

```auto
SlotSet("growth_amt", result if result is not None else [])

```

So I can’t use it in further conversations. On the other hand if I use the commented out return statement-

```auto
return [SlotSet("achieve_amt", result if result is not None else [])]

```

The slot is set but the bot does not utter utter\_growth\_up/down

Is there a solution where the slot gets set and the bot utters the utter\_template?

Thank you, Shruti

---

<div class="post-metadata">

**Author:** ![akelad](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/akelad/32/69_2.png) [@akelad](https://forum.rasa.com/u/akelad)\
**Post date:** [September 14, 2018, 4:16pm UTC](https://forum.rasa.com/t/can-i-use-slotset-and-dispacher-utter-template-in-the-same-action/1024/2 "2018-09-14T16:16:22Z")

</div>

You have to return the SlotSet event, but you can still do `dispatcher.utter_template` too.
