Survey Logic: Specifying the # of child objects while filling out survey

I need to create a survey in which the user specifies the # of widgets that they have and then the system needs to automatically create and display the objects for the widgets in, e.g., an accordian or table.

In this case, Surveys are a table/object and Widgets is a related child table/object.

What I envision is a workflow like the following: The user enters ‘2’ in the betterForms field that corresponds to the number of widgets. The system then performs the equivalent of an onObjectExit that triggers a namedAction which could run a script in fileMaker to a) create the related jsonObject [giving the widgets default names like widget1 and widget2] and then b) refresh the surveyForm so that the User could see the newly created widget objects in a table/accordian.

My main difficulty at this point is I don’t know what an OnObjectExit would be in BetterForms and how to run one??

I think what I would do in this case is have a button. If you simply have an input field the user does not know what action is next after they enter the number. If you have a button, then they know to hit the button and that would run the utility hook.

When the Hook returns, the rest of the page can be populated.