Predicate Builder component setup

task brazil Updated Sep 10, 2026 8 min read predicate-builder-component-uib-setup.md
Raw file servicenow.com

The Predicate Builder enables users to visually assemble filter conditions. Set the appearance of your predicate builder and the information it displays.

Before you begin

This component contains a preset configuration. Presets automatically configure properties and event handlers for a component, making the component ready to work when you add it to a page. You can apply one preset to a single instance of a component on a page. For more information, see Automatically configure components using presets.

A preset connects to a controller, which acts as a data resource for the component. Controllers provide the configuration data and event binding the component needs to function in your experience. For more information see Bind data to UI pages using controllers.

This task assumes you have placed the component on the page and are ready to configure the properties and events. For instructions on accessing and using features in UI Builder, see Customize UI Builder pages using components.

Note: This document describes the latest component functionality. Go to the store to make sure you have the latest version of the component.

Role required: admin or ui_builder_admin

Procedure

  1. Define a label for Predicate Builder that differentiates it from other components in the content tree.

    [Omitted image "predicate-builder-content-tree.png"] Alt text: Predicate Builder in content tree

    A descriptive label makes finding the component easier in a large list of components. For instructions on using the content tree, see Manage UI pages and page variants.

  2. Select the component using one of these methods:

    • Click anywhere within the component.
    • Select the Action bar label you created for your component in the content tree. [Omitted image "predicate-builder-presets.png"] Alt text: Predicate Builder presetsThe preset selection panel appears in the pane on the right.
  3. Either select None to configure the component properties manually, or select one of the available presets to use pre-configured properties and events for the component.

    [Omitted image "predicate-builder-controller.png"] Alt text: Predicate Builder controller configuration

    When you select the first preset on a page, a configuration panel appears with instructions for configuring the required controller for that preset. For more information, see Select a component preset

  4. Supply the data that connects a preset to its controller and select Use.

    UI Builder automatically configures any other presets in the page to use the same controller with the same configuration. For more information, see Add a controller.

Parent Topic:UIB Setup Information

Predicate Builder component properties

Properties in the Predicate Builder component have preset configuration values. You can accept these values or override them manually.

Presets are intended to suit a specific use case. However, you can override a property that has a preset value with a custom configuration if necessary for your design. For details on overriding and resetting presets, see Override a component preset.

Important: Preset values that you override aren't updated automatically when you upgrade the instance.

Available presets

  • Condition builder

    This preset allows users to construct a query for a ServiceNow table. This preset requires the Predicate Builder Controller controller.

    Properties included in this preset are:

    • Display
      • Read Only
      • Show Sort By
      • Show Group By
      • Show Related List Conditions
      • Selected Tab
      • Show Saved Filter Sets
      • Show Save Filter
      • Show Reference Lookup
      • Show Add Condition Set
      • Max Content Height
      • Show Field Labels
    • Condition builder selected as Builder Type
      • Field Operator Relationship
      • Decoded Query
      • Panel Definitions
      • Metadata Cache
      • Variable Source
    • Predicate builder selected as Builder Type
      • Predicate Composition
      • Grouped Predicate Config
      • Custom Components
      • Macroponent SysId
      • Component Tag

Properties

Label [property]

Description

Type[builderType]

Select Condition Builder for creating table queries for use with ServiceNow data or the Predicate Builder for agnostic conditions.Default: CONDITION_BUILDER_TYPE

Choices:

  • Condition builder

[CONDITION_BUILDER_TYPE]

  • Predicate builder

[PREDICATE_BUILDER_TYPE]

Label [property]

Description

Source[source]

Source for where the data comes from for condition builder. Typically this will be a table name.

Label [property]

Description

Basic Filters[basicFilters]

Enable basic filters view.Default: false

Read Only[readOnly]

Prevents users from modifying the filter conditions.Default: false

Show Sort By[showSortBy]

Allow users to include a sort option when creating a filter.Default: true

Show Group By[showGroupBy]

Allow users to include a group by option when creating a filter.Default: true

Show Related List Conditions[showRelatedListConditions]

Allow users to include conditions for a related list in the filter.Default: true

Selected Tab[selectedTab]

Set the tab to be selected.Default: condition

Choices:

  • Conditions

condition

  • Sort by

sort-by

  • Related list conditions

related-list

Show Saved Filter Sets[showLoadFilter]

Allow users to access saved filter sets in the saved filters drop down.Default: true

Show Save Filter[showSaveFilter]

Show the save filter UI to allow users to save filters.Default: true

Show Reference Lookup[showReferenceLookup]

Show the magnifying glass next to reference or variable type fields to allow users to open a reference list.Default: true

Show Add Condition Set[showAddConditionSet]

Show the Add condition set button to allow users to create comparative conditions.Default: true

Max Content Height[maxContentHeight]

Max height of the content area.

Show Field Labels[displayLabelOptions]

Show labels above fields in the condition builder.

Label [property]

Description

Focus on Render[focusOnRender]

Takes keyboard focus on renderDefault: false

Field Operator Relationship[fieldOperatorRelationship]

Configuration to allow for customization of the operators that appear in condition builder.

Customizations[customizations]

Enable configuration on the field and row level.

Decoded Query[decodedQuery]

Predicate builder representation of the encoded query model.

Fixed Decoded Query[fixedDecodedQuery]

A JSON data model that defines the fixed query conditions for Predicate Builder.Note: These conditions are unmodifiable.

Fixed Query Mode[fixedQueryMode]

Switch between simple or distributed mode for handling fixed queries.Choices:

  • Simple
  • Distributed

Default: Simple

Info Messages[infoMessages]

Array of messages to be displayed.

Panel Definitions[panelDefinitions]

Data used to display dot walk panels.

Metadata Cache[metadataCache]

Shared cache stored in the predicate context.

Variable Source[variablesSource]

Configuration to limit the variables that show based on the selected catalog item or variable set.

Label [property]

Description

Predicate Composition[predicateComposition]

Predicate composition data model.

Grouped Predicate Config[groupedPredicateConfig]

Grouped predicate config to customize the grouping styling.

Custom Components[customComponents]

Used to define any custom components or macroponents which will be prefetched on predicate builder load.

Macroponent SysId[macroponentSysId]

Macroponent SysId for custom row rendering that takes precedence over Component Tag.

Component Tag[componentTag]

Component Tag for custom row rendering.

### Manual configuration

To configure properties manually, enter either static or dynamic input. Enter dynamic input by selecting the input type.

Predicate Builder component events

If you have chosen a preset containing events, data handlers for those events are pre-selected by the controller, and no manual configuration is required. If the component has events that aren't included in the preset, you must add data handlers manually to configure those events.

[Omitted image "predicate-builder-events-list.png"] Alt text: Predicate Builder events list

The Events tab shows the events used by the Predicate Builder component. Events with presets are marked with the Preset badge. To show events that do not have preset configurations, select + Add event mapping. If the component has only one event and that event does not have a preset, the event is displayed and is ready for configuration.

Event handlers

[Omitted image "predicate-builder-event-handlers.png"] Alt text: Predicate Builders event handlersEvent handlers work with data resources to link the Predicate Builder actions to the data you want to display to your users. Select the event in the list to add one or more event handlers.

For instruction on how to add and delete event handlers with presets and how to disable an event, see Configure an event handler and Disable preset event mappings.

Preset events

  • Condition builder

    This preset provides data handlers for these events:

    • Predicate Builder Decoded Query Updated
    • Predicate Builder Metadata Request
    • Predicate Builder Panel Definitions Fetch

Event descriptions

Event

Description

Predicate Builder Decoded Query Updated[NOW_PREDICATE_BUILDER#DECODED_QUERY_UPDATED]

An event denoting that the condition builder decoded query has updated.

Predicate Builder Metadata Request[NOW_PREDICATE_BUILDER#FETCH_METADATA]

An event that contains information for the parent to fetch and pass into the metadataCache prop.

Predicate Builder Panel Definitions Fetch[NOW_PREDICATE_BUILDER#FETCH_PANEL_DEFINITIONS]

Used by Condition Builder to populate dot-walk.

Search documentation
Search document titles and file paths on the brazil branch