The right to create forms is enabled to the profiles having the right to update entities in GLPI. Refer to the documentation of GLPI to know how to setup this right.
Forms must be created in the entities where they are intended to be available. A form may be available in its entity and all sub entities if the field Child entities is set to Yes.
- Navigate to Administration > Forms.
- Click on the button to add a form +
Following fields must be populated:
- Name: Name of the form.
- Active: A form is inactive by default. You need to explicitly activate it when it is ready to use.
It is recommended to fill the Category field:
- In the simplified interface, categories allow to tidy forms by Blocks.
- If you want to use the service catalog you must use form categories.
Form categories are plugin’s dropdowns. You can add form categories directly when editing a form using the + next to category field. You can do the same from Configuration > Dropdowns > Form category.
- Direct access on homepage: Direct access to the form from the GLPI’s simplified interface.
- Description: displays in the list forms.
- Language: by default a form is set to the language of its creator. The form will be available only to users using the same language as the form. Choose All languages to make the form available to users without language restriction.
- Header: displays when the form is displayed.
- Need to be validate: If Yes a list of validators is displayed. This is a list of GLPI users (with the right Validate an incident or Validate a request (in its profile) on an compatible entity with the form’s entity. The list of validators is a multiple choice list. If no validator is selected all of them are submitted when the form is being used.
- Default form in service catalog: if Yes the form will display in the service catalog without being filtered by the current category or keywords.
When all fields are filled, click on the add button at the botoom of the page.
Deleting a form is possible only if there are no associated answers. To delete a form, delete all its answers first from the Form answers tab.
After clicking on the tab Question the following page displays:
You must create a first section. Sections are intended to organize questions in the form.
It is possible to setup conditions to show the whole section, based on the answers provided to questions located in other sections of the form.
Click on the link Add a question in a section of your choice.
The following page displays:
A question is made of:
- a title: this is the label of the question in the form.
- a type: see list below.
- a section: the section containing the question. You can move a question to an other section with this field.
- a description; it is displayed under the question in the form. Use it as a hint for the requester, telling him which content is expected.
- a dropdown list Show field to enable a condition
It submits the following choices:
- Always visible: the field is always displays
- Hidden unless: The question is hidden except if answers to other questions matches a condition.
- Displayed unless: The question is displayed except if the answers to other questions matches a condition.
Conditions may be multiple. To add or remove a condition two buttons are available:
List of pictograms
- The circle allows you to make a question mandatory
, or optional
- Arrow up and arrow down allow you to reorder questions in a section.
- Clicking on a question allow you to edit it.
- Two stacked squares allows you to duplicate a question or a whole section.
- The recycle bin allows you to delete a question or a whole section.
Questions are organized on a 4 columns array. You can resize width of questions, reorder them using drag and drop and put up to 4 questions on the same row.
Types of question¶
There are about twenty types of quetions available. Depending on the choosen type, you need to provide additional informations.
- Required: Yes/No. When running the form a red star shows next to label of questions requiring an input.
- Default values: its content depends on the type of the question.
- Range Min/Max: Restricts the value to the given range when runnung the form.
- Additional validation (Regular expression): You may set a custom regex with a regular expression. Use it when other restriction methods cannot satisfy your needs. Don’t forget to specify the delimiters of the regex. You may add any modifier after the closing delimiter.
This field allows you to choose one or several users:
- in GLPI, available in Administration > Users
- not in GLPI, by typing an email address
Checkboxes (multiple choices)¶
Add a line per value in Values. Default values may be set in Default values, one per line. If this field is empty, no checkbox will be ticked.
Date / Datetime / Time¶
This field allows to select a date, a datetime or a time from a mini calendar.
This field only displays informations. Use it to give more details about a question.
This field allows the user to choose a value among those available in a dropdown from GLPI (in Configuration > Dropdowns).
The answer to this type of field must be a syntaxically valid email address.
This field allows the requester to upload a file.
This field must be an float value. Note you may use a regular expression to tighter restrict the answer.
This field allows you to build a dropdown from a GLPI object among those abvailable in the menus:
This field is invisible. It allows to get the hostname if the computer used by the requester, assuming the DNS is able to proprtly solve it from its IP address
This field must be an integer value. Note you may use a regular expression to tighter restrict the answer.
This field is hidden and collects the IP address of the form requester. It does not shows in the form.
This field allows you to create a dropdown list with objects from a LDAP directory:
This type of questions cannot be used to fill actors of a target.
Multiselect (multiple choice)¶
This field allows you to create a dropdown list with ability to select multiple items. Values are added one per line in the field Values. You may set default values, one per line in Default values*. If no default value is set then no item will selected by default.
This field is a dropdown with «Incident» or «Demand» choices. It can be used to set the request type of a ticket being generated by the form.
Select (one choice only)¶
This field allows you to create a dropdown list and set its items. Items are added one per line in Values. Default value may be set in Default value. If there is no default, no item is selected by default.
This field allows you to input a single line of text.
This field allows you to input several lines of text.
This field allows you to select an urgency defined in GLPI.
Conditions are expressions involving questions and sections which are evaluated in order to determine
- if a question is displayed
- if a section is displayed
- if the submit button of a form is displayed
- if a target (see below) must be generated
Available operators in an assertion are:
- not equals
- less than
- greater than
- less than or equal
- greater than or equal
- is visible
- is not visible
- matches a regular expression
The condition expression can be used with the following rules:
- Hidden unless: the item is hidden or not generated except when the expression is true
- Displayed unless: the item is displayed or generated except when the expression is true
Three values are available:
- Public access: Anonymous users may access the form; you may use it in an intranet.
- Private access: Users having a GLPI account may access the form.
- Restricted access: Only users having the specified profiles may access the form.
When a form is set to Public access it is possible to enable a simple captcha. This captcha should prevent spamming if a form is accessible from internet.
Captchas are not enabled by default on anonymous forms. Administrators need to enabled them explicitly depending on how the form may be accessible from an hostile network such Internet.
There are two types of targets for a form:
It is possible to generate any number of targets from a single form. Mixing types of targets is also possible.
To create a target click on the link Add a target
The following window is then displayed:
Choose a target name and type, then validate. The new target is created and is available for tuning.
This tab allows you to view how the form will be rendered and test it without activating it.
Submitting answers from the preview will be actually saved, and will generate targets if the form is not configured with validation.
This tab shows all answers saved for the form.
To delete a form, all its answers must be deleted first. A warning shows at the bottom of the main tab of a form as a reminder.
Menu : Setup > Dropdowns : Forms > Form categories
Form categories allow you to arrange your forms list. Forms are displayed when they belong to the selected category or any sub category. When a form does not have any category, it is displayed when no category is selected or when the user selects «view all».
You can add or edit categories generally from the Setup menu : Setup > Dropdowns.
You can also add new categories directly from the form page like all GLPI dropdowns.
They are defined by entities and can be translated since GLPI 0.85 like all other dropdowns.
Dropdowns translation must be enabled on GLPI general configuration page Setup > General, General setup > Translate dropdowns = Yes
Categories may be associated to Knowledge base categories. This link is necessary to allow FAQ entries to show along your forms.
After the creation of a form, create fields for for the user to fill out.
The name of the questions will appear on the left and the field type selected on the right.
The Description will be under the input field.
Additional options may be displayed depending on the currently selected question type.
If validation of the input is desired, it can be implemented following PHP Regular Expressions.
If you want to show or hide questions depending on the answers of other questions, use the show fields area when editing a question. In the version 2.5.0 you may use more complex expressions checking for the content of several questions, and use logic operator OR and AND. The precedence of boolean operators applies, meaning that AND has precedence over OR.
In some cases a form should be available in several languages. Choose first in which language a form should be created. This language should be english (US or UK) or the language that most of target users understand. This is the fallback language if no alternative is found.
This language is also used as reference in the translation process. Then be sure that the choosen langauge is readable by the user who will translate the form.
To translate a form open the tab Form languages, then create all languages you need to provide to users.
Choose a language added to the form and click it to begin or resume translation, then select the tab Translations. Click the button New translation and a popup dialog will open and show a string to translate. Type the translation, and click save or validate with Enter on your keyboard.
If an other string must be translated, it will show immediately. If no more string needs to be transalted, a message will show instead.
When you close the dialog the list of translated strings is refreshed. You can edit a translation by clicking on it, delete one or several translations with the checkboxes on the left of the list and the Delete button**. You can also filter the list with the filter input box.