Server Configuration - ConfigXFilters.json
File: SYSTEM_DRIVE:/ProgramData/WinQServer/ConfigXFilters.json
Scope: entire system
ConfigXFilters.json defines filters for Device and Calibration records. Filters help users to search specific records or list certain records (f.e. devices past calibration due date).
All filters listed in this file show up on Settings - Filters page in client application, where each user can indivially pick which filters they want to use. Newly added filters are deactivated on Settings - Filters page by default.
Syntax
Each filter is defined by a group between '{' and '}', separated by ',' from another filter. Filter group consists of the following parameters:
FILTER GROUP PARAMETER
|
DESCRIPTION
|
EXAMPLE
|
|
"type"
|
Can be "device" or "calibration". Defines where the filter is supposed to show up.
|
"type": "device",
|
|
"name"
|
Display name for client application users.
|
"name": "Customer",
|
|
"join"
|
Used for advanced filtering using records from multiple SQL tables. Part of SQL command to be added after JOIN clause (including "join")s.
|
"join": "JOIN failure ON device_enr.id=failure.fk_device",
|
|
"sql"
|
Part of SQL command to be added after WHERE keyword. SQL commands can be fixed or further parametrized by arguments as defined below.
|
"sql": "fk_workplace = '{{Location ID}}'",
with Location ID being f.e. 5, this filter will generate SQL command "SELECT * FROM device WHERE fk_workplace = 5"
|
|
"description"
|
Description for client application users.
|
"description": "Displays devices that belong to the customer's selected workplace.",
|
|
"arguments"
|
Arguments allow users to parametrize filters with their inputs. F.e. to search for a particular device based on its serial number. When user clicks on a filter with arguments in client application, a pop-up form with parameter names, inputs and descriptions will appear. Parametrized filter then activates as soon as user types in required inputs and hits OK.
|
"arguments": [{"name": "Serial Number", "type": "string"}],
|
|
|
|
Each argument group consists of the following parameters:
ARGUMENT GROUP PARAMETER
|
DESCRIPTION
|
EXAMPLE
|
"name"
|
Display name for client application users.
|
"name": "Location ID",
|
"type"
|
Argument type. Can be "string", "integer", "decimal", "boolean", "datetime" or "enum".
|
"type": "integer",
|
"description"
|
Description for client application users.
|
"description" : "workplace ID number"
|
"allowedValues"
|
Enum type only. List of available enum values.
|
"allowedValues": ["apple", "orange"],
|
"defaultValues"
|
Default value to be pre-filled in client application form.
|
"defaultValues": "apple",
|
"isArray"
|
Allows multiselect and defines argument as an array of values. Can be "true" or "false".
|
"isArray": "true",
|
|
Example of filter definition:{
"type": "device",
"name": "Customer",
"sql": "fk_workplace = '{{Location ID}}'",
"description": "Displays devices that belong to the customer's selected workplace.",
"arguments": [
{
"name": "Location ID",
"type": "integer",
"description" : "workplace ID number"
}
]
},