title: Rasa - getting slot value for use in custom action
body: <p>How can I extract the value of a slot/entity during a conversation in <code>FormAction.slot_mappings</code> ?</p>
  
  <p>I have the value set in <code>tracker.slots['template_name']</code> , but don't have access to that value from this function.  I am able to access <code>tracker</code> in <code>required_slots</code> but not <code>slot_mappings</code></p>
  
  <p>Rather than hard coding <code>template_name = "example"</code> I'd like to use the slot value for <code>template_name</code>.</p>
  
  <p>This seems like it should be simple to work out, but I can't!</p>
  
  <p><a href="https://rasa.com/docs/rasa/core/forms/" rel="nofollow noreferrer">from looking at the documentation</a>  I thought that <code>self.from_entity(entity='reqd_form')</code> would give me the information, but it returns a blank.</p>
  
  <pre class="lang-py prettyprint-override"><code>from typing import Dict, Text, Any, List, Union, Optional
  from rasa_sdk import Tracker
  from rasa_sdk.executor import CollectingDispatcher
  from rasa_sdk.forms import FormAction
  
  class ExampleForm(FormAction):
      """Example of a custom form action"""
  
      def name(self) -&gt; Text:
          """Unique identifier of the form"""
          return "example_form"
  
      @staticmethod
      def required_slots(tracker: Tracker) -&gt; List[Text]:
          """A list of required slots that the form has to fill"""
          #get a list of the slots required for this particular user
          slots_to_return = util.get_slots(tracker.slots, tracker.sender_id)
          return slots_to_return
  
      def slot_mappings(self) -&gt; Dict[Text, Union[Dict, List[Dict]]]:
          """A dictionary to map required slots to
              - an extracted
              - intent: value pairs
              - a whole message
              or a list of them, where a first match will be picked"""
          template_name = "example"
          test_return = get_slot_mappings(template_name, self)
          return test_return 
  
      def submit(
              self,
              dispatcher: CollectingDispatcher,
              tracker: Tracker,
              domain: Dict[Text, Any],
      ) -&gt; List[Dict]:
          """Define what the form has to do
              after all required slots are filled"""
          return []
  
      def get_slot_mappings(form_name, form):
          #get a list of the slots required for the form
          slot_list = util.get_form_slots(form_name)
          slot_mappings = {}
          for entity_item in slot_list:
              if (entity_item != "ice"):
                  temp_list = []
                  temp_list.append(form.from_entity(entity=entity_item))
                  temp_list.append(form.from_intent(intent="affirm", value=True))
                  temp_list.append(form.from_intent(intent="deny", value=False))
                  slot_mappings[entity_item] = temp_list
                  return slot_mappings
  </code></pre>