Defining query menu questions
You can create query menu questions that insert a menu on the Request Entry console that queries other forms in the system and lists values that users can select.
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. For more information, see Restrictions in creating questions.
- (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.
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.
To restrict the number of records returned from your query menu in the Request Entry console, use the Query Builder to qualify your search. For example, 'Status' = "Active" returns a manageable subset of possible records.
- Click Save.
To build a query in the Query Qualification Builder
To build a query the Query Qualification Builder, enter information in the Qualification field by using the following fields:
You cannot manually edit the text in the Qualification field.
Fields on Selected Form
Select a field from the list. (Qualifications support only fields storing data as strings.)
Select a question, and the user's response is used in the qualification.
Click on the appropriate button to enter syntax.
Select a keyword from the list.
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.
To test query menus
Use the following steps to test your query menu.
- 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
- Make sure that your 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 desired the 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.