JSON Schema Human Task
JSON Schema Human Task
JSON Schema Human Task is a flexible, schema-driven Human Task Type built on the react-jsonschema-form library. It provides a powerful way to create validated forms with dynamic behavior, conditional fields, and custom components.
JSON Schema Human Task can be utilized for:
- Creating complex validated forms with dependencies between fields
- Building dynamic forms that adapt based on user input
- Integrating with EasyRPA Data Stores for dynamic dropdown options
- Displaying read-only information alongside editable fields
- Handling nested objects and arrays with collapsible sections
Document Type JSON Structure
The Document Type configuration consists:
- schema - defines the data structure, types, and validation rules (based on JSON Schema).
- uiSchema - controls the visual presentation, widgets, and layout.
document_validator (optional) - custom JavaScript function for additional validation of output parameters.
Below you can find a comprehensive example of the Settings JSON:
Field Types
Each field in the properties object must have a type and can include several standard validation keywords.
Common Properties (Available for all types)
- type (string) (required) - specifies the data type.
- title (string) (optional) - the label displayed for the field.
- description (string) (optional) - helper text displayed below the label.
- default (any) (optional) - the default value.
- enum (list) (optional) - a list of allowed values (renders as a dropdown or radio buttons).
- readOnly (boolean) (optional) - prevents user editing.
Specific Field Types
String
- minLength / maxLength (number) - constrains text length.
- pattern (string) - a regular expression the value must match.
- format (string) - predefined formats:
email,uri,date,date-time,color.
Number / Integer
- minimum / maximum (number) - range constraints.
- exclusiveMinimum / exclusiveMaximum (boolean) - if
true, it excludes the boundary value. - multipleOf (number) - ensures the value is a multiple of a specific number.
Boolean
Object
Objects allow grouping related fields together. They can be nested and support various validation rules.
Schema Properties:
- properties (object) (required) - defines the fields within the object
- required (array) - list of required property names
- additionalProperties (boolean or object) - controls whether extra properties are allowed
false: no additional properties allowedtrue: any additional properties allowed- object: additional properties must match this schema
- patternProperties (object) - properties whose names match regex patterns
- minProperties / maxProperties (number) - constrains the number of properties
- dependencies (object) - defines field dependencies (see Dependencies section)
This allows users to add custom key-value pairs beyond the defined properties.
Properties matching the pattern ^config_ (e.g., config_timeout, config_retries) must be strings.
Nested Objects:
UI Options for Objects:
Array
Arrays can contain simple values (strings, numbers) or complex objects. They support various configurations for validation and UI behavior.
Schema Properties:
- items (object or array) (required) - defines the schema for array items
- If object: all items follow the same schema (variable-length array)
- If array: each position has its own schema (fixed-length tuple)
- minItems / maxItems (number) - constrains the number of items
- uniqueItems (boolean) - if
true, all items must be unique - additionalItems (object) - schema for items beyond those defined in fixed array
Array Types:
Use "ui:widget": "checkboxes" in uiSchema to render as checkboxes.
UI Options for Arrays:
Schema Composition (oneOf, anyOf, allOf)
Schema composition keywords allow you to combine multiple schemas to create complex validation rules and conditional field structures.
oneOf - Exactly One Schema Must Match
The oneOf keyword ensures that exactly one of the provided subschemas is valid. This is useful for mutually exclusive options.
oneOf with Discriminator:
anyOf - At Least One Schema Must Match
The anyOf keyword validates if at least one of the subschemas is valid. Multiple schemas can match simultaneously.
anyOf with Custom Titles:
Override titles for anyOf options using uiSchema:
allOf - All Schemas Must Match
The allOf keyword combines multiple schemas. The data must be valid against all of them simultaneously. This is useful for schema composition and inheritance.
allOf with Conditional Defaults:
Combine allOf with if-then-else for conditional field behavior:
Comparison Table
| Keyword | Validation Rule | Use Case |
|---|---|---|
| oneOf | Exactly one schema must match | Mutually exclusive options (e.g., payment methods) |
| anyOf | At least one schema must match | Multiple valid configurations |
| allOf | All schemas must match | Schema composition, inheritance, conditional logic |
Layout Grid Configuration
Layout Grid allows you to organize fields into a responsive, multi-column layout using the Bootstrap grid system. It can be applied to any object (including the root form).
To enable grid layout, use the custom field "ui:field": "LayoutGridField" in your uiSchema.
How to use?
Grid layout is configured in the uiSchema using the LayoutGridField custom component.
1. schema requirements
2. uiSchema configuration
Grid Options
- ui:field (string) - must be set to
"LayoutGridField"to enable grid layout - ui:layoutGrid (object) - contains the grid configuration
- ui:row (object) - the container for columns
- className (string) - Standard Bootstrap class (e.g.
"row","row align-items-center") - children (array) - List of column configurations
- className (string) - Standard Bootstrap class (e.g.
- ui:col (object) - defines column width and content
- xs, sm, md, lg, xl (number) - Grid size (1-12) according to Bootstrap breakpoints
xs- extra small screens (< 576px)sm- small screens (≥ 576px)md- medium screens (≥ 768px)lg- large screens (≥ 992px)xl- extra large screens (≥ 1200px)
- children (array) - List of field names from the
schemato render inside this column
- xs, sm, md, lg, xl (number) - Grid size (1-12) according to Bootstrap breakpoints
- ui:row (object) - the container for columns
Nested Grid Layouts
Available Widgets
Widgets define the input control used to render a field. Apply using "ui:widget": "widgetName" in uiSchema.
Standard Widgets (react-jsonschema-form)
For boolean fields
radio- radio button group withtrue/falseoptionsselect- dropdown withtrue/falseoptions- default: checkbox
For string fields
textarea- multi-line text inputpassword- masked password inputcolor- color pickeremail/uri/date/date-time/time- based on format- default: regular text input
For number and integer fields
updown- number input with up/down buttonsrange- sliderradio- radio buttons for enum values- default: number input
Other
hidden- hidden fieldfile- file upload (use withformat: "data-url")
Custom Widgets
SelectWidget
Custom select dropdown with improved handling of initialization values.
- Widget Name:
SelectWidget - Difference from standard rjsf select: When the input value is not present in the available options (enum), the standard rjsf select displays the raw value. SelectWidget handles this case gracefully by displaying an empty selection instead.
Custom Fields Reference
Custom fields are applied using "ui:field": "FieldName" and can completely change the rendering of a property.
1. TitleField
Displays a large section heading.
- Used with: Any property where you want a header label.
- Schema: Uses
titleproperty.
2. LinkField
Displays one or more clickable links.
- Used with: String fields that contain URLs, or special Link Objects from Input JSON.
- Schema: Supports a custom
linkproperty to define a base URL, which is then extended by input data. - Rendering: Renders as a blue hyperlink.
3. BadgesField
Converts an array of strings into a list of styled badges (pills).
- Used with: Array of strings (e.g., document tags, OCR marks).
- Styling: Each item is rendered with a gray background and rounded corners.
4. TextareaField
Provides a large text input area with optional collapsible support.
- Collapsible Feature: Controlled by
"collapsible": truein the schema. - Collapsing Behavior: If collapsible, the textarea starts in a compact state and expands only when clicked or when it has focus. Useful for long descriptions or error logs.
5. DynamicSelectField
A powerful field that connects to EasyRPA Data Stores to provide dynamic options.
- Specific Schema Keywords:
dataStore: Name of the Data Store to search.textName: Field name from the Data Store record to use as the value.filter: Object defining search criteria (e.g.{"status": [{"predicate": "EQUALS", "value": "ACTIVE"}]}).
- Behavior: Fetches options from the server and shows a loading spinner while data is being retrieved.
Custom Schema Keywords (Custom)
These keywords extend standard JSON Schema to provide extra functionality in this application:
- hideIfEmpty (boolean) - hides the field from the form if it is not populated by the Input JSON.
- collapsible (boolean) - used with
TextareaFieldto make it collapsible. - dataStore (string) - used with
DynamicSelectFieldto link to an EasyRPA Data Store. - link (string) - used with
LinkFieldto define a base link path.
Custom Validation (document_validator)
The document_validator is a custom JavaScript function defined in settings for additional validation of output parameters beyond standard JSON Schema validation.
- Location:
settings.document_validator - Type: string (JavaScript function)
- Input: Receives the form data object (
document) - Output: Returns an array of error messages (empty array = valid)
The function runs after standard form validation. If it returns errors, they are displayed alongside field-level validation errors.
Input JSON Structure
The Input JSON populates the form with initial data and can dynamically modify field properties.
Input JSON Processing Rules
- Link Merging: Objects with
linkortitlefrom Input JSON are merged into the schema, allowing you to dynamically set link labels and URLs. - Placeholder Replacement: Schema defaults like
placeholder_xxxare replaced by input values (e.g.,"user": "Alex"replacesplaceholder_user). - Overrides: Allows modifying schema properties (
title,readOnly, etc.) at runtime for specific fields. - Hide If Empty: Fields with
"hideIfEmpty": trueare removed if missing in Input JSON.
Output JSON Structure
The Output JSON represents the resulting form data after user submission. The output structure strictly follows the property names defined in the schema.
Important Architectural Note:
The JSON Schema Human Task does not process or utilize the incoming outputJson object.