# Error while trying to run form

**URL:** <https://forum.rasa.com/t/error-while-trying-to-run-form/58011>\
**Category:** Feedback on Rasa Open Source\
**Tags:** community, rasa\
**Created:** [April 17, 2023, 7:37am UTC](https://forum.rasa.com/t/error-while-trying-to-run-form/58011 "2023-04-17T07:37:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tanveer](https://avatars.discourse-cdn.com/v4/letter/t/22d042/32.png) [@Tanveer](https://forum.rasa.com/u/Tanveer)\
**Post date:** [April 17, 2023, 7:37am UTC](https://forum.rasa.com/t/error-while-trying-to-run-form/58011/1 "2023-04-17T07:37:00Z")

</div>

Hi i am new to rasa can any one help me to sort out this bug When i trying to run my custom action form i m getting this error

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/3X/7/c/7c10cc2bd60451b56d7b51ba8d4609c3e7620c6b.png)

My Form is

class ProductSearchForm(FormValidationAction): “”“Example of a custom form action”“”

```
def name(self) -> Text:
    """Unique identifier of the form"""

    return "product_search_form"

@staticmethod
def required_slots(tracker: Tracker) -> List[Text]:
    """A list of required slots that the form has to fill"""

    return ["ram","battery","camera","budget"]

#def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:
    """A dictionary to map required slots to
        - an extracted entity
        - intent: value pairs
        - a whole message
        or a list of them, where a first match will be picked"""

    #return []

def validate_ram(
    self,
    value: Text,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> Dict[Text, Any]:
    """Validate num_people value."""
    #4 GB RAM
    # 10 GB RAM --> integers/number from this -- 10
    #
    ram_int = int(re.findall(r'[0-9]+',value)[0])
    #Query the DB and check the max value, that way it can be dynamic
    if ram_int < 50:
        return {"ram":ram_int}
    else:
        dispatcher.utter_message(template="utter_wrong_ram")

        return {"ram":None}

def validate_camera(
    self,
    value: Text,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> Dict[Text, Any]:
    """Validate num_people value."""
    #4 GB RAM
    # 10 GB RAM --> integers/number from this -- 10
    #
    camera_int = int(re.findall(r'[0-9]+',value)[0])
    #Query the DB and check the max value, that way it can be dynamic
    if camera_int < 150:
        return {"cam":camera_int}
    else:
        dispatcher.utter_message(template="utter_wrong_camera")

        return {"camera":None}

def validate_budget(
    self,
    value: Text,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> Dict[Text, Any]:
    """Validate num_people value."""
    #4 GB RAM
    # 10 GB RAM --> integers/number from this -- 10
    #
    budget_int = int(re.findall(r'[0-9]+',value)[0])
    #Query the DB and check the max value, that way it can be dynamic
    if budget_int < 4000:
        return {"budget":budget_int}
    else:
        dispatcher.utter_message(template="utter_wrong_budget")

        return {"budget":None}

def validate_battery(
    self,
    value: Text,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> Dict[Text, Any]:
    """Validate num_people value."""
    #4 GB RAM
    # 10 GB RAM --> integers/number from this -- 10
    #
    battery_int = int(re.findall(r'[0-9]+',value)[0])
    #Query the DB and check the max value, that way it can be dynamic
    if battery_int < 50:
        return {"battery":battery_int}
    else:
        dispatcher.utter_message(template="utter_wrong_battery")

        return {"battery":None}

# USED FOR DOCS: do not rename without updating in docs
def submit(
    self,
    dispatcher: CollectingDispatcher,
    tracker: Tracker,
    domain: Dict[Text, Any],
) -> List[Dict]:

    dispatcher.utter_message(text="Please find your searched items here.........")

    return []

```

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [April 18, 2023, 3:28am UTC](https://forum.rasa.com/t/error-while-trying-to-run-form/58011/2 "2023-04-18T03:28:29Z")

</div>

You need to follow the [docs](https://rasa.com/docs/rasa/forms/#dynamic-form-behavior). `required_slots` is a method within a `FormValidationAction` class.
