Form in action

I am working on a project where i need to get the name and age from user.Suppose the i want to insert three people name and age.I was trying to call name form from action but i have getting error.` i have tried this method: class ActionHelloWorld(Action):

 def name(self) -> Text:
     return "action_hello_world"

 def run(self, dispatcher: CollectingDispatcher,
         tracker: Tracker,
         domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

     dispatcher.utter_message(text="Hello World!")
     mode=tracker.get_slot("number")
     for i in range(0,3):
        return [FollowupAction('action_followup_check')]

class ActionFollowCheck(Action):

def name(self) -> Text:
    return "action_followup_check"

def run(self, dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:
    dispatcher.utter_message(text="this is action after hello world")
    print("Followup action running")

    return []         

but it is not working.Any solution or any suggestions?

Review the forms docs an example and best practices. class ActionFollowCheck(Action) tells me that you aren’t using forms.

from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker from rasa_sdk.executor import CollectingDispatcher from rasa_sdk.events import FollowupAction

class ActionHelloWorld(Action):

 def name(self) -> Text:
     return "action_hello_world"

 def run(self, dispatcher: CollectingDispatcher,
         tracker: Tracker,
         domain: Dict[Text, Any]) -> List[Dict[Text, Any]]:

     dispatcher.utter_message(text="Hello World!")
     mode=tracker.get_slot("number")
     for i in range(0,3):
         print(i)
         return[FollowupAction('restaurant_form')]

i want to run the restaurant_form form three times but it is not working

You could take another approach and add slots for number_collected and finished_names. As you collect names increment number_collected. Use the dynamic form required_slots method to count when you’ve collected to set finished_names to a non-null value and the form will complete.