- About XNAT
- News & Events
- XNAT Marketplace
- Contact Us
Custom forms can only be created by Site Admin or users with Custom Form Manager role.
A form is applicable to a datatype and a form can have a site wide scope or project(s) level scope. As multiple forms can exist for a given datatype, you can specify the display order for these forms.
Creating a form involves specifying:
Form creation is nothing but creating the form schema. A form schema is represented as a JSON internally in XNAT.
Login to XNAT as a Site Admin or as a Custom Form Manager user. Navigate to Tools → Custom Forms → Manage Data Forms.
You will be directed to the Custom Form Management dashboard.
Click on Add New to begin the process of creating a new form. The form creation wizard will walk you through three steps in order to create a form.
Select the form scope - Site wide or specific to project(s).
If the form scope is site wide, the form will be displayed for the datatype in any project.
You can restrict the form to specific projects. In order to do so, select No and select the projects for which the form should be rendered for the datatype.
You can drag and drop a form component to start creating the form definition (aka form schema).
Adding a component onto the form involves setting the properties of the component as per your needs.
form.io has been customised to render and build forms in XNAT. Components that can be added onto a form are grouped into the following categories:
Each form component has properties which can be set while adding the component to the form.
More information about each form component is available here (XNAT version of the form component may not expose all properties of a component as mentioned on the form.io website).
Once added, against each component, you can access the component menu bar, as shown below, by hovering over the component.
The menu consists of:
Once all components have been added, click Save to save the form. The form dashboard will now show the form you have created.
Each form saved is assigned a universally unique identifier (UUID) by XNAT. The uuid of the form is displayed on the form dashboard below the form title. Once the form is saved, users can enter form data when creating a new entity for the datatype.
All forms for a datatype are rendered in the Edit and Report pages of the datatype. For all the datatypes, the forms are rendered while creating an entity of the datatype. Once the entity data is saved, form data can be viewed in the report pages and included in search listing (all components other than the ones that belong to the Non-searchable group).
Form data can be entered while creating a new project.
This data can be viewed from the Details tab on the project report page by clicking View Custom Fields.
Form data for a project, can be edited using Edit Details on the Details tab of the Project report page.
Form data can be entered while creating a new subject or an experiment.
This data can be viewed on the report page of the subject (or experiment).
Existing form data can be edited using Edit link in the Actions box on the report page.
The form data is saved in XNAT under the custom_fields element for an entity. The custom_fields is also represented as a JSON. Data of a form is structured under the form uuid as key-value pairs in the custom_fields.
The value of Property Name property in the API tab of a component is the key against which the data of this component is saved in the custom_fields JSON. This value is automatically generated when a label is assigned for the component, however, you can modify this value.
The form management dashboard displays forms available in a XNAT instance. The dashboard contains information about a form, the datatype it applicable to, its scope, the form creator and actions that can be performed for a form.