Difference between revisions of "Mapping Fields from Customised Forms"

From Hornbill
Jump to navigation Jump to search
Line 7: Line 7:
 
== Introduction ==
 
== Introduction ==
  
When creating customised forms, and custom questions the default behaviour is for the question and answer to be visible on the request form in a '''Questions''' collapsable section. It is also possible to map the answer from a custom question to one of the default fields on a request.  
+
Any information captured in customised forms results in the question and answer to be visible on the request form in a '''Questions''' collapsable section. Custom forms also support field mapping which is a mechanism that allows us to write the information to the main request table.
 +
 
 +
===Why would I use field mapping?===
 +
 
 +
Field mapping is desirable for two reasons:
 +
:# to make the answers to custom questions more accessible for reporting (i.e. Measures, Widgets, Reports).
 +
:# to make the answers to custom questions available in email templates.
 +
 
 +
The information gathered in a progressive capture custom form is stored in a table h_itsm_questions and is intended to act as a sort of audit history displaying what information was provided at the point the request was logged. This is why the questions section is not editable.
 +
<br>
 +
The way the data is stored in the table h_itsm_questions does not offer us much flexibility when it comes to reporting and also means is not accessible via the email template variable picker. The exercise of field mapping ensures the data is written to h_itsm_requests (the main request table) which means it is readily available.
 +
 
 
|style="width:5%"|
 
|style="width:5%"|
 
|
 
|
Line 13: Line 24:
  
 
== Related Articles ==
 
== Related Articles ==
:* [[Customised_Forms|Customised forms]]
+
:* [[Customised_Forms|Customised forms]]  
 
|}
 
|}
  
 
== Field ID ==
 
== Field ID ==
When creating a custom question on a customised form, each question will require a Field ID to be specified, it is here that the mapping can be performed. When defining the Field ID, if you use any of the following values, the answer to this question will be mapped to the field you have specified.  
+
When creating a custom question on a customised form, each question will require a Field ID to be specified, it is here that the mapping can be performed. When defining the Field ID, if you use any of the following values, the answer to this question will be mapped to the database column you have specified.  
  
[[File:Mapping_Custom_Fields.png|600px]]
+
[[File:Mapping_Custom_Fields.png|400px|thumb|<div align="center">'''Field mapping takes place when a supported database column name is specified as the field id of a custom field.'''</div>]]
  
 
===Available Fields to Map to===
 
===Available Fields to Map to===
  
To map a custom form answer to one of the supported database columns, the form field ID need to be set using the following format '''h_custom_a''' or appropriate column you would like to map to. The table below lists all the database fields that support field mapping and the type of content that they can hold.
+
To map a custom form answer to one of the supported database columns, the form field ID need to be set using the following format '''h_custom_a''' or appropriate column you would like to map to. The table below lists all the database columns that support field mapping and the type of content that they can hold.
  
{| class="wikitable" width="100%" style="text-align: left"
+
{| class="wikitable" width="70%" style="text-align: left"
  
! width = "5%" | Available Columns
+
! width = "180px" | Available Columns
! width = "10%" | Data Type/Capacity
+
! width = "220px" | Data Type/Capacity
! width = "25%" | Description
+
! width = "600px%" | Description
  
 
|-
 
|-
Line 40: Line 51:
 
|-
 
|-
 
| align = "left"            |<!-- Column Name  --> h_description
 
| align = "left"            |<!-- Column Name  --> h_description
|                            <!-- Data Type/Capacity --> TEXT/10,000 characters (approximately)
+
|                            <!-- Data Type/Capacity --> TEXT/unlimited*
 
|                            <!-- Description        --> The description field of a request
 
|                            <!-- Description        --> The description field of a request
  
Line 46: Line 57:
 
| align = "left"            |<!-- Column Name  --> h_custom_a - h_custom_o
 
| align = "left"            |<!-- Column Name  --> h_custom_a - h_custom_o
 
|                            <!-- Data Type/Capacity --> VARCHAR/255 characters
 
|                            <!-- Data Type/Capacity --> VARCHAR/255 characters
|                            <!-- Description        --> VARCHAR custom fields a - o each suitable for holding up to 255 characters of any type.
+
|                            <!-- Description        --> ''VARCHAR'' custom fields a - o each suitable for holding up to 255 characters of any type.
  
 
|-
 
|-
 
| align = "left"            |<!-- Column Name  --> h_custom_p - h_custom_t
 
| align = "left"            |<!-- Column Name  --> h_custom_p - h_custom_t
|                            <!-- Data Type/Capacity --> TEXT/10,000 characters (approximately)
+
|                            <!-- Data Type/Capacity --> TEXT/unlimited*
|                            <!-- Description        --> TEXT custom fields p - t each suitable for holding large amounts of text characters of any type.
+
|                            <!-- Description        --> ''TEXT'' custom fields p - t each suitable for holding large amounts of text characters of any type.
  
 
|-
 
|-
 
| align = "left"            |<!-- Column Name  --> h_custom_21 - h_custom_25
 
| align = "left"            |<!-- Column Name  --> h_custom_21 - h_custom_25
|                            <!-- Data Type/Capacity --> DATETIME/a single date-time stamp YYYY-MM-dd HH:mm:ss
+
|                            <!-- Data Type/Capacity --> DATETIME/a single date-time stamp
|                            <!-- Description        --> DATETIME custom fields 21 - 25 each suitable for holding a single date-time stamp YYYY-MM-dd HH:mm:ss. This should be used in conjunction with a date-time picker.
+
|                            <!-- Description        --> ''DATETIME'' custom fields 21 - 25 each suitable for holding a single date-time stamp (YYYY-MM-dd HH:mm:ss). These columns should ONLY be used in conjunction with a date-time picker.
  
 
|-
 
|-
 
| align = "left"            |<!-- Column Name  --> h_custom_26 - h_custom_30
 
| align = "left"            |<!-- Column Name  --> h_custom_26 - h_custom_30
 
|                            <!-- Data Type/Capacity --> INTEGER/any whole number  
 
|                            <!-- Data Type/Capacity --> INTEGER/any whole number  
|                            <!-- Description        --> DATETIME custom fields 26 - 30 each suitable for holding whole numbers
+
|                            <!-- Description        --> ''INTEGER'' custom fields 26 - 30 each suitable for holding whole numbers. When mapping to these columns, ensure the following RegEx is specified in your Custom field settings: ''[0-9]''
 
|}
 
|}
 
<br>
 
<br>
Line 67: Line 78:
 
* This will allow for the original answer to be retained
 
* This will allow for the original answer to be retained
 
* The default fields values can be changed once logged
 
* The default fields values can be changed once logged
 +
* unlimited* - TEXT fields have a maximum capacity of 65000 characters.
  
 
===Considerations===
 
===Considerations===
  
 
* When specifying the field you wish to map to in your custom form id, '''this value is case sensitive'''. e.g. ''h_summary'' will acheive the desired mapping but ''h_'''S'''ummary'' will fail to pull any values through. Ensure that the mapped field is written in lower case.
 
* When specifying the field you wish to map to in your custom form id, '''this value is case sensitive'''. e.g. ''h_summary'' will acheive the desired mapping but ''h_'''S'''ummary'' will fail to pull any values through. Ensure that the mapped field is written in lower case.
* If the Default '''Request Details''' form is used in your progressive capture flow, and you try to map to h_summary or h_description, the values will not overwrite or be written to the summary or description fields, but the custom questions and answers will still be written to the '''Questions''' section on the request.
+
* If the Default '''Request Details''' form is used in your progressive capture flow, and you try to map to h_summary or h_description, the values will not overwrite or be written to the summary or description fields i.e. the standard "Request Details" form takes precedence, but the custom questions and answers will still be written to the '''Questions''' section on the request.
 
* If the same mapping is used on different custom forms in your progressive capture flow, the first mapping will be written to the specified default field on the request, and any subsequent mapping to the same field will not overwrite this value, but will be written to the '''Questions''' section on the request.
 
* If the same mapping is used on different custom forms in your progressive capture flow, the first mapping will be written to the specified default field on the request, and any subsequent mapping to the same field will not overwrite this value, but will be written to the '''Questions''' section on the request.
 
+
* When creating your email template, simply look for the '''custom''' options available from the variables drop down pick list. By selecting the required variable in your email template, this will pass through the answer from your custom question which has been mapped to the corresponding custom field.
===Using Custom Questions and Answers in Email Templates & Measures===
 
 
 
If you have a requirement to include the answers to custom questions in email templates within your business process, it is now possible to utilise the above mapping to write the answers to the custom questions into default fields which are immediately available to use as variables when creating your email templates.
 
 
 
By using the above mapping to any of the requests custom fields, when creating your email template, simply look for the '''Extended Information''' options available from the variables drop down pick list. They will look like this: '''<nowiki>{{Extended Information.H_custom_x}}</nowiki>'''.  The Extended Information options are listed as 1 through to 20 and these equate to the custom fields a through to p which you will have mapped to.  By selecting the required variable in your email template, this will pass through the answer from your custom question which has been mapped to the corresponding custom field.
 
 
 
* '''Update -  From Service Manager 2.41''' mapped answers are also written to the custom columns in the primary h_itsm_requests table (custom a-p), this will allow the custom fields to be used when defining email template variables using the available custom fields, and also as criteria when creating measures in the Advanced Analytics.  This update only applies to data in mapped fields for requests logged after the release of Service Manager 2.41.  The mapped answers are still also mapped to the above Extended Information table.
 
  
 
[[Category:Administration]]
 
[[Category:Administration]]

Revision as of 09:29, 21 February 2018

Home > Administration > Progressive Capture Designer > Mapping Fields from Customised Forms

Introduction

Any information captured in customised forms results in the question and answer to be visible on the request form in a Questions collapsable section. Custom forms also support field mapping which is a mechanism that allows us to write the information to the main request table.

Why would I use field mapping?

Field mapping is desirable for two reasons:

  1. to make the answers to custom questions more accessible for reporting (i.e. Measures, Widgets, Reports).
  2. to make the answers to custom questions available in email templates.

The information gathered in a progressive capture custom form is stored in a table h_itsm_questions and is intended to act as a sort of audit history displaying what information was provided at the point the request was logged. This is why the questions section is not editable.
The way the data is stored in the table h_itsm_questions does not offer us much flexibility when it comes to reporting and also means is not accessible via the email template variable picker. The exercise of field mapping ensures the data is written to h_itsm_requests (the main request table) which means it is readily available.

Related Articles

Field ID

When creating a custom question on a customised form, each question will require a Field ID to be specified, it is here that the mapping can be performed. When defining the Field ID, if you use any of the following values, the answer to this question will be mapped to the database column you have specified.

Field mapping takes place when a supported database column name is specified as the field id of a custom field.

Available Fields to Map to

To map a custom form answer to one of the supported database columns, the form field ID need to be set using the following format h_custom_a or appropriate column you would like to map to. The table below lists all the database columns that support field mapping and the type of content that they can hold.

Available Columns Data Type/Capacity Description
h_summary VARCHAR/255 characters The Summary field of a request
h_description TEXT/unlimited* The description field of a request
h_custom_a - h_custom_o VARCHAR/255 characters VARCHAR custom fields a - o each suitable for holding up to 255 characters of any type.
h_custom_p - h_custom_t TEXT/unlimited* TEXT custom fields p - t each suitable for holding large amounts of text characters of any type.
h_custom_21 - h_custom_25 DATETIME/a single date-time stamp DATETIME custom fields 21 - 25 each suitable for holding a single date-time stamp (YYYY-MM-dd HH:mm:ss). These columns should ONLY be used in conjunction with a date-time picker.
h_custom_26 - h_custom_30 INTEGER/any whole number INTEGER custom fields 26 - 30 each suitable for holding whole numbers. When mapping to these columns, ensure the following RegEx is specified in your Custom field settings: [0-9]


When custom questions have been mapped to a default request field, the question and answer are still available in the Questions section on a request as well as the default fields mapped too.

  • This will allow for the original answer to be retained
  • The default fields values can be changed once logged
  • unlimited* - TEXT fields have a maximum capacity of 65000 characters.

Considerations

  • When specifying the field you wish to map to in your custom form id, this value is case sensitive. e.g. h_summary will acheive the desired mapping but h_Summary will fail to pull any values through. Ensure that the mapped field is written in lower case.
  • If the Default Request Details form is used in your progressive capture flow, and you try to map to h_summary or h_description, the values will not overwrite or be written to the summary or description fields i.e. the standard "Request Details" form takes precedence, but the custom questions and answers will still be written to the Questions section on the request.
  • If the same mapping is used on different custom forms in your progressive capture flow, the first mapping will be written to the specified default field on the request, and any subsequent mapping to the same field will not overwrite this value, but will be written to the Questions section on the request.
  • When creating your email template, simply look for the custom options available from the variables drop down pick list. By selecting the required variable in your email template, this will pass through the answer from your custom question which has been mapped to the corresponding custom field.