This documentation applies to the 8.1 version of Service Request Management, which is in "End of Version Support." You will not be able to leave comments.

To view the latest version, select the version from the Product version menu.

Adding questions to an SRD

This topic describes how to add questions to a service request definition (SRD). You can map the questions to variables or SR fields.

Note

If you are localizing SRDs, you must add, sort, and map questions only in the default locale for the SRD. For more information, see Localizing SRDs.

To add questions to an SRD

  1. Search for the SRD, select it, and click View
  2. After you enter a PDT in the Process Template field, click Questions & Mappings under the Process Template field.
  3. On the Questions tab, create questions to ask your users.
    1. Select New Question.
    2. In the Question Text field, enter the question you want to add. You can also add any value that a browser can read, such as hyperlinks. See Adding hyperlinks in an SRD.
      If you want to enter the greater than (>) or less than (<) sign in the Question Text field, use encoded text (&gt for >, and &lt for <); otherwise, browsers will interpret the greater than and less than signs as HTML markup, which is not supported. For more information, see Restrictions in creating questions.
    3. Select a question format (for example, Text or Menu). 
      For more information about creating each question format, see Creating questions to use with SRDs.
    4. In the Instructions field, enter instructions on responding to the question.

    5. Specify whether the question is Required, Hidden, or Read Only.
      Text, Date, Time, and Date/Time questions can be made read-only. Hidden questions are for internal data processing and are not visible to users or administrators. You cannot hide Date, Time, and Date/Time questions. For more information, see Restrictions in creating questions.
    6. Based on the question format, specify the question details.
      For example, a text question requires that you define the default response, the number of text rows, and the limit input length.
      You can also specify a regular expression to validate user response. If a user enters a response that does not match the the pattern specified by the regular expression, the system displays a general error message. See Examples of regular expressions.

      Notes

      You must add a forward slash (/) at the beginning and at the end of regular expression strings.

      Use the Instructions field to show an example, such as(800)555-1212or1-800-555-1212     , to show the user how to match the pattern required by the regular expression. The system does not provide any prompts to help the user correct errors.

    7. To create your question, click Apply.
    8. (Optional) Click Add Condition to dynamically define additional questions that appear in the context of the answer. See Adding branch conditions to questions.

  4. To specify the order in which the questions will appear in the SRD (when it appears in the Request Entry console), select the question and click the Up button to move it up or click the Down button to move it down.
  5. To remove a question from the list of available questions, select it from the navigation tree and click Delete.
  6. To map variables to questions, click the Variable Mapping tab.
    See Mapping variables to questions.
  7. To map questions to fields on the Service Request form, click the SR Field Mapping tab.
    See Mapping service request fields.

Examples of regular expressions

  • The following regular expression specifies a pattern for the phone number: (555) 555-1212:

    /^([\(]{1}[0-9]{3}[\)]{1}[ ]{1}[0-9]{3}[\-]{1}[0-9]{4})$/
    
  • The following regular expression specifies the pattern for email addresses in the format <name>@example.com

    /[\w\d_-]+@[\w\d_-]+\.[\w\d._-]+/
    
  • The following regular expression specifies the pattern for numeric input from 1 to 365, for the days of the year:

    /^(?:36[0-5]|3[0-5]\d|[12]\d{2}|[1-9]\d?)$/

Related topics

Creating questions to use with SRDs

Localizing SRDs

This version of the documentation is no longer supported. However, the documentation is available for your convenience. You will not be able to leave comments.

Comments

  1. Gregory Kiyoi
    1.  Should show an example of an error message when you enter an value that is in the incorrect format for the regular expression (as it is not very friendly and not helpful to indicate what has failed).
    2. Should recommend they add instructions field information when using a regular expression to help the user understand the format.  As the above phone number and email are great, but if the user doesn't know the format they will get a very unfriendly error message and cause frustration.
    3. We should tell what regular expression values are supported or are all supported?
    4. Here is a regular expression that will only allow input from 1-365 (done for a customer that needed to enter days of the year).  This can be added as another example.

    /^(?:36[0-5]|3[0-5]\d|[12]\d{2}|[1-9]\d?)$/


    Attached is a word doc showing the error and the above RE, possibly you can pull screenshot for error message? .Text Question that uses Regular Expression to limit input to values.docx

    Aug 16, 2013 10:25
  2. David Dcruz

    Can we have more examples of regular expressions.

    Eg: Starters Name : FirstName,Last Name,Initials

            Text-tEXt;Text-tEXt,

    Nov 28, 2014 04:41
    1. Catherine Siderine

      Hi David,

      Thanks for your suggestions. I'll check with the team to see how to create these examples.

      Regards,

      Cathy

       

      Dec 03, 2014 03:36
  3. Pascal Etienne

    Seems to me that the link 'Adding branch conditions to questions' sends back to the same 'Adding questions to an SRD' page which gives no explanation on the subject.

    Dec 30, 2014 06:35
    1. Catherine Siderine

      Thanks, Pascal. I have updated the link so that it points to the correct information.

      Regards,

      Cathy

      Jan 07, 2015 08:22
  4. Roland Geilen

    Would be good to add an example of a hyperlink.  The link in the article only shows adding a single link to an SRD in the Instructions or Description.  I need to provide the user with a link based on the answer to a question?

    cheers, Roland

    Mar 31, 2016 02:00
    1. Catherine Siderine

      Hi Roland,

      Thanks for your comment. Restrictions in creating questions says that hyperlinks are not supported in question text or responses, so this might involve some customization. You could do a search or post a question in BMC Communities to see if someone has ideas about how to do this.

      Regards,

      Cathy

      Apr 04, 2016 03:18
  5. Pedro Cardoso

    Hi, do you know if multilne validation is supported? I need to validate that only numbers with 15 digits are enter, no matter is only one line o many..

    thanks

    May 23, 2019 10:46
    1. Gregory Kiyoi

      Pedro,

      If 15 digits is what you are matching, but can be on multiple lines:


      123456789012345\n

      123456789012345\n

      123456789012345\n


      You can match on the '\n' at the end $ of the line so 15 digits followed by whitespace newline character to validate.  You will need to test to confirm get the correct behavior  (ignore spaces before and after the 15 digits before the \n newline or do you even allow any spaces or only the 15 digits).

      --GMK



      May 24, 2019 07:24