Skip to main content

Overview

The Job Question DocType is a child table DocType that represents individual questions within a Job Question Set. It cannot exist independently and must be part of a Job Question Set.

Fields

question
Data
required
The question text displayed to job applicantsProperties:
  • Required field
  • Shown in list view
  • Plain text input
fieldname
Data
Internal field name used to store the answerProperties:
  • Read-only
  • Hidden from UI
  • Auto-generated identifier
input_type
Select
Type of input control for the questionOptions:
  • Checkbox
  • Select (default)
Properties:
  • Hidden from UI
  • Read-only
  • Default value: “Select”
required
Check
Whether the question must be answeredProperties:
  • Checkbox (0 or 1)
  • Default: 0 (not required)
  • Shown in list view
order
Int
Display order of the question in the formProperties:
  • Integer value
  • Shown in list view
  • Used to control question sequence

Properties

istable
boolean
True - This is a child table DocType that must be used within a parent document
editable_grid
boolean
True - Questions can be edited directly in the grid view

Permissions

As a child table, Job Question inherits permissions from its parent DocType (Job Question Set). It has no independent permissions.

JSON Structure

{
  "doctype": "DocType",
  "name": "Job Question",
  "module": "ION Career",
  "istable": 1,
  "editable_grid": 1,
  "fields": [
    {
      "fieldname": "question",
      "fieldtype": "Data",
      "label": "Question",
      "reqd": 1,
      "in_list_view": 1
    },
    {
      "fieldname": "fieldname",
      "fieldtype": "Data",
      "label": "Fieldname",
      "read_only": 1,
      "hidden": 1
    },
    {
      "fieldname": "input_type",
      "fieldtype": "Select",
      "label": "Input Type",
      "options": "Checkbox\nSelect",
      "default": "Select",
      "read_only": 1,
      "hidden": 1
    },
    {
      "fieldname": "required",
      "fieldtype": "Check",
      "label": "Required",
      "default": "0",
      "in_list_view": 1
    },
    {
      "fieldname": "order",
      "fieldtype": "Int",
      "label": "Order",
      "in_list_view": 1
    }
  ],
  "permissions": []
}

Usage

Adding Questions to a Set

import frappe

# Get or create a Job Question Set
qset = frappe.get_doc("Job Question Set", "Developer Screening")

# Add a new question
qset.append("questions", {
    "question": "Do you have experience with Git?",
    "fieldname": "git_experience",
    "input_type": "Select",
    "required": 1,
    "order": 3
})

qset.save()

Reading Questions

# Iterate through questions
qset = frappe.get_doc("Job Question Set", "Developer Screening")

for q in qset.questions:
    print(f"Q{q.order}: {q.question}")
    print(f"  Fieldname: {q.fieldname}")
    print(f"  Required: {'Yes' if q.required else 'No'}")
    print(f"  Type: {q.input_type}")

Updating Question Order

qset = frappe.get_doc("Job Question Set", "Developer Screening")

# Re-order questions
for idx, question in enumerate(qset.questions, start=1):
    question.order = idx

qset.save()

Example Document

{
    "doctype": "Job Question",
    "question": "Do you have 5+ years of Python experience?",
    "fieldname": "python_experience_5y",
    "input_type": "Select",
    "required": 1,
    "order": 1
}

Field Naming Convention

The fieldname field should follow these conventions:
  • Use snake_case (lowercase with underscores)
  • Be descriptive and unique within the question set
  • Avoid special characters and spaces
  • Example: python_experience, work_authorization, remote_preference

Input Types

Checkbox

Presents a single checkbox for yes/no questions. The answer is typically “1” (checked) or “0” (unchecked).

Select

Presents a dropdown with predefined options (typically “Yes” or “No”). The answer is the selected option text.

Validation

Questions marked as required=1 will be validated by the validate handler to ensure applicants provide answers.

Build docs developers (and LLMs) love