Leave a comment at the end of this page or email contact@krishagni.com
How to Create a New Form Using an Existing Form as a Template
If you want to create a new form that is similar to an existing form, you do not need to manually recreate all fields.
The recommended method is:
Download the existing form XML → Rename the form → Import it as a new form
This approach saves time and ensures all fields, rules, and validations are copied correctly.
Steps to Create a New Form
Step 1: Export the Existing Form
Go to the Forms module in OpenSpecimen.
Open the form you want to use as a template.
Click on Download XML.
Save the XML file to your system.
Step 2: Modify the XML File
Open the downloaded XML file in a text editor (e.g., VS Code, Notepad++).
Update the following:
Form Name (<name>) → must be unique in the system.
Form Caption / Title (<caption>) → Update to the new form title.
If you want to modify field names or captions
Field <name> must be unique within the form.
Field <udn> must also be unique within the form.
Save the file with a new filename.
Example
Existing Form XML
<form>
<view>
<name>custom_field_form</name>
<caption><![CDATA[Custom Field Form]]></caption>
</view>
</form>
Modified XML for New Form
<form>
<view>
<name>new_custom_field_form</name>
<caption><![CDATA[New Custom Field Form]]></caption>
</view>
</form>
In this example:
custom_field_form → changed to new_custom_field_form
Caption updated to reflect the new form name
Make sure the new <name> does not already exist in the system.
Example of Modifying a Field
Existing Field
<textField>
<name>specimen_details</name>
<udn>specimen_details</udn>
<caption><![CDATA[Specimen Details]]></caption>
</textField>
Modified Field
<textField>
<name>new_specimen_details</name>
<udn>new_specimen_details</udn>
<caption><![CDATA[New Specimen Details]]></caption>
</textField>
Here:
Field <name> updated
Field <udn> updated
Caption modified
Make sure the new <name> and <udn> do not already exist in the form.
Step 3: Import the Form as New
Go back to the Forms module.
Click on Import → Upload the modified XML file.
Click Import.
The new form will be created with the same structure as the existing form.