Add and remove subform instances using scripting

You can add or remove subform instances by adding calculations or scripts to objects on your form. It is important to name the subforms when adding and removing subforms instances though scripting. Scripting against existing subforms is error prone when the subforms are accessed through a relative position instead of unique names.

Before you begin, perform the following tasks:

  • If it is not already visible, display the Script Editor by selecting Windows > Script Editor. Expand the Script Editor so that it is displayed in multiline view.

  • Ensure that the subform that you want to add instances to is contained within a flowed subform.

    You can also use the Action Builder dialog box on the Tools menu to build common interactive capabilities in forms that have a flowable layout, without writing scripts. See Building actions in forms.

// Ethnio survey code removed