Creating menu questions
To define static menu questions
- Open the Questions & Mappings dialog box for an SRD.
- On the Questions tab, click Add Question.
- In the Question Text field, enter a question for users.
If you want to enter the greater than (>) or less than (<) sign in the Question Text field, use encoded text (> for >, and < for <); otherwise, browsers will interpret the greater than and less than signs as HTML markup, which is not supported. - (Optional) In the Instructions field, enter instructions for responding to the question.
- In the Question Format field, select Menu.
- In the Menu Type field, select Static.
- In the Displayed Value field, enter the value that appears to users (for example, Accounting).
- In the Stored Value field, enter the actual value stored in the database (for example, Calbro Accounting).
While the Displayed Value determines what the user sees on the screen, the Stored Value determines the value that is processed in the system. By default, they are the same. If you choose to set a different Stored Value, you must also specify Internally Represented Response in the question mapping. For more information, see Question format restrictions.
Do not enter the same Stored Value for different Displayed Value. - Click Add.
- Repeat step 7 through step 9 for each option you want to add.
- Click Save.
To define query menu questions
- Open the Questions & Mappings dialog box for an SRD. See Adding questions to an SRD.
- On the Questions tab, click Add Question.
- In the Question Text field, enter a question for users.
If you want to enter the greater than (>) or less than (<) sign in the Question Text field, use encoded text (> for >, and < for <); otherwise, browsers will interpret the greater than and less than signs as HTML markup, which is not supported. - (Optional) In the Instructions field, enter instructions on responding to the question.
- In the Question Format field, select Menu.
- In the Menu Type field, select Query.
- In the Form Name field, select a form (for example, AP-Sample:Restaurant).
- In the Display Label field, select the field associated with the form.
- (Optional) Edit the Actual Value field.
While the Display Label determines what the user sees on the screen, the Actual Value determines the value that is processed in the system. By default, they are the same. If you choose to set a different Actual Value, you must also specify Internally Represented Response in the question mapping. For more information, see Question format restrictions.
Do not enter the same Actual Value for different Display Label. To define a qualification, click Query Builder to open the Query Qualification Builder.
If you do not create a qualification, the query menu shows all restaurant records from the AP-Sample:Restaurant form.
For more information, see To build a query in the Query Qualification Builder.- Click Save.
To build a query in the Query Qualification Builder
To build a query, enter information in the Qualification field of the Query Qualification Builder by using the following fields:
Field
Action
Fields on Selected Form
Select a field from the list. (Qualifications support only fields storing data as strings.)
Question
Select a question, and the user's response is used in the qualification.
Text
- From the menu next to the Text field, select the option that corresponds to the type of text that you want to enter:
- Text enables you to enter text.
- Integer enables you to enter numerals that are treated as integers.
- Enter the text to include in the qualification.
- Click Add.
Syntax buttons
Click on the appropriate button to enter syntax.
Keywords
Select a keyword from the list.
- From the menu next to the Text field, select the option that corresponds to the type of text that you want to enter:
- Click the Undo button to undo your actions. (You can undo only the last action.) Click Clear to delete the entire qualification and start over. You cannot manually edit the text in the Qualification field.
To test query menus
To test your query menu, perform the following actions. This procedure assumes that you already know how to create application templates, AOTs, PDTs, and SRDs.
- Create a work order template.
- Create an AOT that registers the work order template.
- Create a PDT that consumes the AOT.
- Create and deploy an SRD.
- Request the service from the Request Entry console.
- Choose the query menu in the Provide Information panel, and select an item.
For example, you add the Detailed Description field to the target data. When you select a restaurant and submit the request, this value is entered in the Detailed Description field of the work order.
Tips for constructing query menus
- Ensure that the users have the correct permissions to access information. The list of forms in the Form Name field shows all forms that include data, regardless of multi-tenancy or permissions. As a result, requesters must have access to the form selected from the Form Name field for the question to work. For example, if you select CHG:InfrastructureChange from the Form Name field, but a user who is logged in to the Request Entry console does not have Change User permissions, no data appears on that menu for that user.
- Select the form that contains the set of values you need to view. If your form has a list of unique values for a field, you can construct a query menu question to return those values from the query. If you cannot find a form that returns the desired values from a dynamic query, you must create it.
- Select a character field from a primary form that has one value for each record (a one-to-one relationship). Avoid using join forms because these typically have one-to-many relationships and appear in the Request Entry console as duplicate entries.
When you query the AP-Sample:Restaurant form to retrieve a list of restaurants, for example, the query returns all the records. Each record is for a different restaurant name, and so there is no duplication. - Do not enter the same Actual Value for different Display Label.
If you are creating a query menu while creating an SRD, you can create a dynamic query menu, which is an extension of a query menu. You can create a question that depends on the answer to a previous question. For example, after you select a restaurant, you select the cost of that restaurant.
To avoid circular results, do not create a dynamic query menu that depends on the answer of another question, which similarly requires an answer from the original question. For example, Question 1 should not depend on the answer to Question 2 if Question 2 requires an answer from Question 1.
To define dynamic query menus
- Search for the SRD, select it, and click View.
- After you enter a PDT in the Process Template field, click Questions & Mappings.
See Adding a PDT to an SRD. - Click Add Question.
- In the Question Text field, enter a question for users.
If you want to enter the greater than (>) or less than (<) sign in the Question Text field, use encoded text (> for >, and < for <); otherwise, browsers will interpret the greater than and less than signs as HTML markup, which is not supported. - (Optional) In the Instructions field, enter instructions on responding to the question.
- In the Question Format field, select Menu.
- From the Menu Type list, select Query.
- From the Form Name field, select the form that includes the answers (for example, AP-Sample:Restaurant).
- From the Display Label field, select the field associated with the form.
- In the Actual Value field, leave the default value or edit the field.
- To construct a qualification:
- Click Query Builder.
- Using the fields and buttons in the dialog box, enter a qualification in the Qualification field.
From the Question list, you can select a question that is already defined in the SRD. The data you retrieve depends on the response to the question you select in the Question field.
For example, you might define a question (Restaurant Location) that uses a dynamic query menu. The menu queries the Restaurant Locations form with this qualification: 'Restaurant' = <Restaurant Example>
The menu for the Restaurant Location question will list all locations for the restaurant specified in the preceding Restaurant Example question. Without a qualification, all locations are listed, regardless of the restaurant selected. - Click Select.