Configuring AI models for questionnaire answering

Configure custom machine learning models to automatically populate answers in questionnaire assessments. AI models can analyze questionnaire content and related object data to generate appropriate responses.

Before you begin

Before configuring AI models for questionnaire answering:

  • Ensure you have the Custom Machine Learning Models application permission
  • Have access to a deployed AI model on a supported extension service type
  • Understand the questionnaire structure and the types of questions that need AI-generated answers
  • Identify which object types and fields should be used as context for answer generation

About this task

AI models for questionnaire answering use a specialized Questionnaire input type that provides the questionnaire JSON structure and question details to the model. The model analyzes this information along with related object data and any attached files to generate answers.

Tip: In OpenPages® 9.2.1, AI models can be configured at the questionnaire template level and are used to generate answers for all questions in the questionnaire.

Procedure

  1. Open the Administration menu and select Integrations > Custom Machine Learning Models.
  2. Click New model to create a new model configuration.
  3. Enter a Name and Label for the model.
    Use a descriptive name that indicates the model is for questionnaire answering, such as "Questionnaire Auto-Answer Model".
  4. Configure the connection to your AI model by selecting Extension as the service type and providing access parameters.
    For detailed information about connecting to AI models, see Setting up a connection to your model.
  5. Optional: In the Response timeout (seconds) field, enter the maximum time to wait for the model response.
    Enter a value of at least 1 second and up to a maximum of 300 seconds. The default is 120 seconds.
  6. In the Map inputs section, configure the following settings:
    1. For Input type, select Questionnaire.
      This input type provides the questionnaire JSON structure and question details to the model.
    2. For Object type, select the object type that questionnaire assessments are typically associated with (such as Asset, Process, Risk, or Use Case).
      The model will have access to fields from this object type to use as context when generating answers.
    3. Optional: Enable file attachments.
      Enable Include file attachment, select Upload operation, and then configure model input fields and the $FileResponse field if you want the model to analyze uploaded documents. When enabled, all files attached to the questionnaire assessment object are sent to the model in a single request, allowing the model to draw answers from multiple documents at once (for example, a contract and a SOC 2 report). File upload support requires Gemini or OpenAI models.
    4. For Operation, select from the list.
    5. Select Test connection to validate the configuration.
    6. For Map the model input fields to OpenPages, define the input mapping that sends the prompt and questionnaire data to the model.
      • For the questionnaire JSON input, enter the expression depending on your AI provider, for example input[0].content[0].text for Open AI, and include variables that reference object fields
      • You can reference questionnaire-specific variables such as $questionnaireJSON$ for the entire questionnaire structure
      • Include object field variables to provide context, such as [$System Fields:Description$] or other relevant fields from the selected object type
      Important: In your prompt, you must explicitly instruct the AI model to return answers in a specific JSON structure that matches the output mapping configuration. The JSON structure should include fields for question ID, answer text, and optionally reasoning and confidence score. Without this instruction, the model may return responses in an incompatible format that cannot be parsed correctly.
  7. In the Map outputs section, configure how the model returns answers:
    1. Add output mapping for Question ID. Example JSONata string: choices[0].message.content.answers.questionId
    2. Add output mapping for Answer. Example JSONata string: choices[0].message.content.answers.[answer])

      For multi-check questions you might get several answer for a question, so the answers are returned in an array [answer] in the jsonata

    3. For the JSONata string, enter the path to extract question IDs from the model response, such as choices[0].message.content.answers.questionId.
      This extracts the list of question IDs from the model's response.
    4. Optional: Add output mapping for reasoning:
      Reasoning- The explanation or rationale for why the AI model selected this answer. Example JSONata string: choices[0].message.content.answers.reasoning
    5. Optional: Add output mapping for confidence score.
      Confidence Score - The model's confidence in the answer. Example JSONata string: choices[0].message.content.answers.confidenceScore)
    6. Optional: Configure confidence threshold.
      Set the minimum confidence threshold to control which answers are applied.
  8. For Model action, select Automatically set.
    This setting is required for questionnaire input types and ensures the model runs when triggered by the user.
  9. Click Save to save the model configuration.
  10. Associate the AI model with a questionnaire template:
    1. Navigate to Assessments > Questionnaire templates.
    2. Open the questionnaire template you want to configure.
    3. Click the Editor tab.
    4. In the bottom left of the editor, click Add AI models icon button.
    5. In the dialog box, select one or more AI models to associate with the questionnaire template.
      You can associate multiple models to give users options when populating answers.
    6. Click Select to save the association.

Results

The AI model is now configured and associated with the questionnaire template. When users create questionnaire assessments from this template, they can use the Populate Answers feature to run the AI model and automatically generate answers.

What to do next

After configuring the AI model:

  • Test the model with a sample questionnaire assessment to verify answer quality
  • Adjust prompts and field mappings as needed to improve results
  • Communicate to users which questionnaire templates have AI-powered answering available
  • Monitor model usage and performance through audit logs