Skip to main content
Kinetic Community

Question Elements

Question elements can be added to a Service Item using the question function. The question function takes two string arguments. The first is the text label of the question element. The second argument is the actual question text to be displayed.

Question Flags

The :free_text, :email, :integer, :decimal, :date, :date_time, :numeric_range, :attachment, :dynamic_list, and :list flags are used to configure the question type. One of these flags is required for all question elements.

The :blank flag sets the question label to blank.

The :required flags sets the question to required.

The :hidden flag sets the question to hidden.

The :removed flag sets the question to removed.

The :read_only flag sets the question to read-only (Kinetic Request 5.1.0).

The :advance_default flag configures the question to use an advanced default answer.

Question Options

The :editor_label option configures the editor label of the question element.

The :answer_mapping option configures the answer mapping of the question.

The :default_answer option configures the default answer of the question.

The :default_form option configures the default form used in the advanced default.

The :default_field option configures the default field used in the advanced default.

The :default_qual option configures the qualification used in the advanced default.

The :help_text option configures the help text of the question element.

The :required_text option configures the user prompt for required field.

The :pattern_label option configures the pattern label field for answer validation. If a pattern label is configured but the pattern is not, the pattern will be retrieved using the pattern label.

The :pattern option configures the pattern for answer validation.

The :validation_text option configures the user prompt for answer style validation. If pattern validation is used but validation text is not configured the default validation text will be used.

The :style_class option configures the style class of the question element.

The :field_map_number option configures the field map number of the question element.

Question Functions

The event function (Chapter 7).

The style function (Chapter 8).

The bridged_dynamic_default function (Kinetic Request 5.1) will configure the question to use a bridged resource as its default answer value.  See Bridged Resources for details and examples regarding bridged resources.

Free Text Questions

A free text question can be created by using the question function and including the :free_text flag.

Free Text Question Options

The :size option configures the size of the free text question.

The :rows option configures the number of text rows of the free text question.

The :max option configures the max number of characters of the free text question.

Free Text Question Creation

question "Free Text", "Free Text", :free_text,
  :size => "20",
  :rows => "2"

The free text question above is configured to have 2 rows of size 20.

Email Questions

An email question can be created by using the question function and including the :email flag. Email questions require the use of pattern validation, if the :pattern or :pattern_label flags are not used the default pattern for email questions will be used.

Email Question Options

The :size option configures the size of the email question.

Email Question Creation

question "Email", "Email", :email,
  :size => "30"

The email question above is configured to have a size of 30.

Integer Questions

An integer question can be created by using the question function and including the :integer flag. Integer questions require the use of pattern validation, if the :pattern or :pattern_label flags are not used the default pattern for integer questions will be used.

Integer Question Options

The :size option configures the size of the integer question.

Integer Question Creation

question "Integer", "Integer", :integer,
  :size => "10"

The integer question above is configured to have a size of 10.

Decimal Questions

A decimal question can be created by using the question function and including the :decimal flag. Decimal questions require the use of pattern validation, if the :pattern or :pattern_label flags are not used the default pattern for decimal questions will be used.

Decimal Question Options

The :size option configures the size of the decimal question.

Decimal Question Creation

question "Decimal", "Decimal", :decimal,
  :size => "20"

The decimal question above is configured to have a size of 20.

Attachment Questions

An attachment question can be created by using the question function and including the :attachment flag.

Attachment Question Flags

The :enforce_file_types flag configures the attachment question to enforce the file types it allows.

Attachment Question Options

The :size option configures the size of the attachment question.

The :file_size_limit option configures the file size limit (kb) of the attachment question.

The :upload_label option configures the upload button label of the attachment question.

The :clear_label option configures the clear button label of the attachment question.

The :file_types option configures the file types allowed by the attachment question. This flag requires the :enforce_file_types flag.

Attachment Question Create

question "Attachment", "Attachment", :attachment,
  :enforce_file_types,
  :size => "20",
  :rows => "1",
  :file_size_limit => "1024",
  :upload_label => "Load",
  :clear_label => "Clear",
  :file_types => ".pdf"

The attachment question above is configured to enforce file types with the file type .pdf allowed and a size limit of 1024(kb). Also the upload and clear buttons are given the labels Load and Clear respectively.

Date Questions

A date question can be created by using the question function and including the :date flag.

Date Question Flags

The :english_dates flag configures the answer style of the date question to English dates full.

The :spanish_dates flag configures the answer style of the date question to Spanish dates full.

The :show_calendar flag configures the date question to show calendar.

The :allow_blank flag configures the date question to allow blank.

Date Question Creation

question "Date", "Date", :date,
  :spanish_dates,
  :show_calendar,
  :pattern_label => "Year must be four characters",
  :pattern => "(19|20)\\d\\d[- /.](0[1-9]|1[012])[- /.](0[1- 9]|[12][0-9]|3[01])",
  :validation_text => "Date (Year must be four characters)"

The date question above will use Spanish dates and will be configured to show the calendar.

Date/Time Questions (Kinetic Request 5.0)

A date/time question can be created by using the question function and including the :date_time flag.

Date/Time Question Flags

The :english_dates flag configures the answer style of the date/time question to English dates full.

The :spanish_dates flag configures the answer style of the date/time question to Spanish dates full.

The :show_calendar flag configures the date/time question to show calendar.

The :allow_blank flag configures the date/time question to allow blank.

The :display_question_value flag configures the date/time question to display question value.

The :hide_date_fields flag configures the date/time question to hide date fields. This flag requires the :show_calendar flag.

The :hide_time_fields flag configures the date/time question to hide time fields.

Date/Time Question Creation

question "Date Time", "Date Time", :date_time,
  :english_dates,
  :show_calendar

The date/time question above will use English dates and will be configured to show the calendar.

Numeric Range Questions

A numeric range question can be created by using the question function and including the :numeric_range flag.

Numeric Range Question Flags

The :list_box, :check_box, and :radio_button flags configure the type of the numeric range question. One of these is required for all numeric range questions.

The :horizontal and :vertical flags configure the justification of the numeric range question. Only one of these can be used for one question.

The :apply_na flag configures the numeric range question to apply not applicable.

Numeric Range Question Options

The :minimum option configures the minimum value of the numeric range question.

The :maximum option configures the maximum value of the numeric range question.

The :na_value option configures the n/a value of the of the numeric range question.

Numeric Range Question Creation

question "Numeric Range", "Numeric Range", :numeric_range,
  :list_box,
  :horizontal,
  :minimum => "0",
  :maximum => "10"

The numeric range question above will be a list box question with numeric choices ranging between 0 and 10.

Dynamic List Questions

A dynamic list question can be created by using the question function and including the :dynamic_list flag.

Dynamic List Question Flags

The :use_get_entry flag (Kinetic Request 5.0) configures the dynamic list question to use get entry.

Dynamic List Question Options

The :form option configures the form of the dynamic list question.

The :label_field option configures the label field of the dynamic list question.

The :value_field option configures the value field of the dynamic list question.

The :sort_field option configures the sort field of the dynamic list question.

The :qualification option configures the qualification of the dynamic list question.

The :date_format option configures the date format of the dynamic list question.

Dynamic List Question Functions

The bridged_dynamic_list function (Kinetic Request 5.1) will configure the dynamic list to use a bridged resource as its source.  See Bridged Resources for details and examples regarding bridged resources.

Dynamic List Question Creation

question "Dynamic List", "Dynamic List", :dynamic_list,
  :form => " Employee",
  :label_field => "Name",
  :value_field => "Id",
  :sort_field => "Id",
  :qualification => "1=1"

The dynamic list question above will be a list box question with choices retrieved from the Employee form. The Name field will be the choice label and the Id field will be the choice value.

List Questions

A list question can be created by using the question function and including the :list flag. List questions refer to a choice list specified by the :choice_list option. If the choice list has not been defined, use of the choice function is required within the code block passed to the question function.

List Question Flags

The :list_box, :check_box, and :radio_button flags configure the type of list question. One of these flags is required for all list questions.

The :horizontal and :vertical flags configure the justification of the list question.

The :apply_na flag configures the list question to apply not applicable.

List Question Options

The :choice_list option configures the list name of the list question.

The :na_value option configures the n/a value of the list question.

List Question Functions

The choice function (Chapter 14).

The check_box_map function (Chapter 15).

List Question Creation

question "List Box", "List Box", :list,
  :list_box,
  :horizontal,
  :choice_list => "YesNo" do
  choice "Yes"
  choice "No"
end

This list question above will be a list box question with choices Yes and No.

question "Radio Button", "Radio Button", :list, 
  :radio_button, 
  :horizontal, 
  :choice_list => "YesNo"

The list question above will be a radio button question with choices Yes and No (if a choice list is already defined in a service item we do not need to redefine the choices, we simply need to refer to the existing choice list).

question "Check Box", "Check Box", :list,
  :check_box,
  :horizontal,
  :choice_list => "Hardware",
  :field_map_number => "1" do
  choice "Monitor"
  choice "Desktop"
  choice "Keyboard"
  check_box_map "Desktop", "2"
end

The list question above will be a check box question with choices Monitor, Desktop, and Keyboard. There is also a field map number assigned to the check box choice Desktop.