Skip to main content

Query Builder Interface

Overview: Query Builder

The Docwize query builder is located in the ‘New’ Module, under ‘Custom Fields.’ This lists created views, as well as provides the place for users to create new queries to build new views.

workflow-builder

'Query Builder' button

'Virtual Views' dialog

When users navigate to the 'Query Builder' section, they encounter the 'Virtual Views' dialog.

workflow-builder

'Virtual Views' dialog

FieldDescription
Create New ViewNavigates to the Query Lab canvas.
(Various names)List of names of created views.

The Query Lab

When users click on 'Create New View', they are directed to the Query Lab. Queries are built in the Query Lab's canvas.

workflow-builder

Example: 'Query Lab' canvas

query-builder

Query Builder: An example query

The Query Lab has four main sections.

Left-hand Section

FieldDescription
Custom FieldsLists all available Custom Fields to select from.
TablesEnables users to select the template type (grid, gridlink, filter) for the display of the custom fields.
ViewsEnables users to select the display mode, choosing between a form or a grid.
Virtual ViewsIf a grid Display Mode is selected, this enables users to select if it allows for one or multiple.
SearchAI Extraction Prompt
When selected, populates a dropdown menu of additional fields.
Enables users to select a field to drag onto the canvas to create a node.

Upper Central Section

This is the query builder canvas. Users can select items from the lefthand section to drag into the canvas. Fields that are dragged and dropped appear as a node.

workflow-builder

Example: Node

FieldDescription
Enables users to link nodes as they build a complex query.
Includes the column in the select.
DescriptionThe column name. Note: Double clicking allows you to rename the column.

There are certain fields in a node which are standard:

FieldDescription
OwnIDUnique ID in the table/view.
EntityidUsually represents a document ID.
Entitytype“D” for Document.
EntrydateDate the row was inserted.
EntrypersonUser ID of the user who did the insert.
entrybatchidUUID unique to a batch insert.

Bottom Central Section

FieldDescription
Configure QueryToggles between the ‘Configure Query’ and ‘Results’ view, where users can view output columns, add static or runtime filters and add groupings to the query.
ResultsToggles between the ‘Configure Query’ and ‘Results’ view, where users can view output columns, add static or runtime filters and add groupings to the query. See additional details below.
ColumnsColumn descriptions for the output query.
ConditionsEnables users to apply static and runtime filters.
GroupingsEnables users to apply grouping and aggregations.

When viewing the 'Results' view, users have access to the following:

FieldDescription
Select AllFetch all rows.
Page SizeBatch size for pagination.
No/no rowsTotal rows in the query.
Query TimeTime taken for query to execute.

Right-hand Section

FieldDescription
Allows users to connect to external databases.
Loads the backend representation of a query (in JSON) for confirmation and/or editing.
Uses the jsonlogic query as the source instead of the diagram.
This will autoformat edits to JSON.
Assists in fixing query errors.
Test QueryEnables users to run the query to preview results.
Save DatasourcePrompts the pop-up dialog for a user to save the created datasource.

How to Build a Query

StepDescription
1Select for the relevant field(s), dropping and dragging them onto the Query lab canvas, where they convert to nodes.
2Make the relevant row(s) visible on the selected nodes.
3Optional: link rows across nodes.
4Click on ‘Test Query’ and navigate to the bottom central section to confirm what is populated. Adjust if needed.
5NOTE: remember to click on ‘Set as Source’ once editing is complete.
6Click on ‘Save Datasource’ and input a name.