Toggle menu

Form Blueprints and Snippets

Form blueprints let you save a form and then reuse it as the starting point for new forms. They behave in much the same way as a regular public or private form, but will never need to be published as they are only used during the development of other forms.

Form snippets allow commonly used collections of fields to be saved and reused.

Creating and Using Blueprints

Blueprints can be created from the forms explorer in the same way as any other type of form. Right-click on the group where you would like to create a blueprint and select "Create a form > Blueprint".

Alternatively, a blueprint can be created from an existing public or private form. Right-click on a form and select the "Create a blueprint using..". Edit the form as required and click "Save this blueprint" in the action panel.

Once a blueprint exists, it can be used as the starting point for creating new forms. Right-click on a blueprint and select "Create a form using.." A copy of the blueprint will be opened in the standard form editor for you to work on as a new form.

Creating and Using Snippets

Snippets are collections of fields that can be saved and reused on other forms. They are organised into groups and appear alongside the field types in the right hand menu of the forms designer. You can drag them onto your form and all of the fields in the snippet, including any JavaScript saved in them when the snippet was created, will become part of your form.

You can create a snippet from the forms explorer in the same way as any other type of form. Right-click on the group where you would like to create a snippet and select "Create a form > Snippet".

Snippets can also be created when you are working in the forms designer. Right-click on a field, or a layout field with other fields inside it, and select "Save this field as a snippet".

iCM will prompt you to give the snippet a name and description. It will be saved in the same group as your current form (and can be moved later). Remember that a snippet is simply a special type of form, so the name and description will be used to identify the snippet in the forms explorer and search.

Once you have added a snippet to your form, the fields within it have no link to the original snippet and are treated like any other fields on your the form. Updating the original snippet won't have any effect on the snippet fields that have been added to other forms. In other words, when used, the fields added by a snippet are no longer a snippet.

Field Names in Snippets

When you add a snippet to your form, if the names of any fields in the snippet conflict with any fields already on your form, they will be changed. For example, if you form already has a field called NAME, a field in the snippet called NAME would be renamed NAME2.

When a field in the snippet is renamed, the forms designer checks for any references to it within the snippet, and updates them too. This is to make sure that any JavaScript or templating within the snippet continues to function after a field name has been changed. This checking applies to field names in:

  • Default functions
  • Handler functions
  • Validation functions
  • Template manipulation functions
  • Buttons
  • The script action field
  • The history writing actions
  • The workflow actions
  • Handlebars templates that use the {{FIELD}} helper
  • Tokens that use the #FIELDNAME# field substitution

If you create form variables using the Form Variable field, and don't set a variable name (ie, you use the field name as the variable name) references to that name will be updated too. You'll see this when using the Handlebars {{VARIABLE}} helper and tokens that use the %VARIABLENAME% substitution.

Last modified on 01 March 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon