Repository: rasahq/rasa
Issue: Global Slot Mappings: Dynamic slots not considered in `_get_slot_extractions`

### Rasa Open Source version

3.0.0rc1

### Rasa SDK version

3.0.0rc1

### Rasa X version

_No response_

### Python version

3.9

### What operating system are you using?

OSX

### What happened?

When I try to fill a dynamically requested slot a `ActionExecutionRejection` is raised.

To reproduce:

1. Specify a form and a required slot
2. Add a `validate_<form_name>` action to your domain
3. Override `required_slots` in your `FormValidationAction` so that it requests a `slot2` if `slot1` as a certain value
4. When Rasa Open Source asks you to fill slot2 → fill it
5. Expected: Form is submitted since all values are filled
Actual: The form rejects it's execution as `_get_slot_extractions` returns an empty list. As this means we have a `slot_to_validate` and `some_slots_were_validated==False` the form rejects its execution

```python
version: "2.0"

intents:
  - greet
  - goodbye
  - affirm
  - deny
  - mood_great
  - mood_unhappy
  - bot_challenge
  - start_form

actions:
  - validate_tobi_form

entities:
  - entity1
  - entity2
  - entity3
  - entity4
  - entity5
  - entity6

slots:
  slot1:
    type: any
    influence_conversation: false
    mappings:
    - type: from_entity
      entity: entity1
      conditions:
      - active_loop: tobi_form
        requested_slot: slot1

  slot2:
    type: any
    influence_conversation: false
    mappings:
    - type: from_entity
      entity: entity1
      conditions:
      - active_loop: tobi_form
        requested_slot: slot2

responses:
  utter_greet:
  - text: "Hey! How are you?"

  utter_cheer_up:
  - text: "Here is something to cheer you up:"
    image: "https://i.imgur.com/nGF1K8f.jpg"

  utter_did_that_help:
  - text: "Did that help you?"

  utter_happy:
  - text: "Great, carry on!"

  utter_goodbye:
  - text: "Bye"

  utter_iamabot:
  - text: "I am a bot, powered by Rasa."

  utter_ask_slot1:
  - text: "Slot 1 please"

  utter_ask_slot2:
  - text: "Slot 2 please"

  utter_ask_slot3:
  - text: "Slot 3 please"

  utter_ask_slot4:
  - text: "Slot 4 please"

  utter_ask_slot5:
  - text: "Slot 5 please"

  utter_ask_slot6:
  - text: "Slot 6 please"

  utter_submit:
  - text: "Submitted"

session_config:
  session_expiration_time: 60
  carry_over_slots_to_new_session: true

forms:
  tobi_form:
    required_slots:
    - slot1
```

```python
from typing import Dict, Text, Any, List

from rasa_sdk import Tracker
from rasa_sdk.executor import CollectingDispatcher
from rasa_sdk.forms import FormValidationAction

class TobiFormValidation(FormValidationAction):
    def name(self) -> Text:
        return "validate_tobi_form"

    async def required_slots(
        self,
        domain_slots: List[Text],
        dispatcher: "CollectingDispatcher",
        tracker: "Tracker",
        domain: "DomainDict",
    ) -> List[Text]:
        """Returns slots which the validation action should fill.

        Args:
            domain_slots: Names of slots of this form which were mapped in
                the domain.
            dispatcher: the dispatcher which is used to
                send messages back to the user.
            tracker: the conversation tracker for the current user.
            domain: the bot's domain.

        Returns:
            A list of slot names.
        """
        if tracker.slots["slot1"] == "beer":
            return domain_slots + ["slot2"]

        return domain_slots
```

### Command / Request

_No response_

### Relevant log output

_No response_

Changed files:
rasa/core/actions/forms.py

diff --git a/rasa/core/actions/forms.py b/rasa/core/actions/forms.py
index 8e13ece3d0b..10690e2cc25 100644
--- a/rasa/core/actions/forms.py
+++ b/rasa/core/actions/forms.py
@@ -355,6 +355,17 @@ class FormAction(LoopAction):
 
         return slot_values
 
+    def _add_dynamic_slots_requested_by_dynamic_forms(
+        self, tracker: "DialogueStateTracker", domain: Domain,
+    ) -> Set[Text]:
+        required_slots = set(self.required_slots(domain))
+        requested_slot = self.get_slot_to_fill(tracker)
+
+        if requested_slot:
+            required_slots.add(requested_slot)
+
+        return required_slots
+
     def _get_slot_extractions(
         self, tracker: "DialogueStateTracker", domain: Domain,
     ) -> Dict[Text, Any]:
@@ -363,12 +374,16 @@ class FormAction(LoopAction):
         )
         slot_values = {}
 
+        required_slots = self._add_dynamic_slots_requested_by_dynamic_forms(
+            tracker, domain
+        )
+
         for event in events_since_last_user_uttered:
             if not tracker.active_loop:
                 # pre-filled slots were already validated at form activation
                 break
 
-            if event.key not in self.required_slots(domain):
+            if event.key not in required_slots:
                 continue
 
             slot_values = self._update_slot_values(event, tracker, domain, slot_values)