Working with Activeboard inputs
Inputs are Activeboard elements that let you apply filters to data in your Activeboard's widgets. The values you specify in an input are automatically inserted in the widget's query, which allows you to easily display different data in your widgets. Currently, there are two types of inputs available:
- Input - Creates a free-text field in the Activeboard.
- Select - Creates a drop-down list with a limited set of values. The list of values available can be either fixed or the result of a query.
The following video is an introduction to inputs:
Adding inputs to an Activeboard
To add an input to a Activeboard, click the Inputs button at the top of the Activeboard, then click and drag your selected input style to the Activeboard workspace.
To edit the input's settings, click its title bar. The Data tab has the same options as all widgets. The Visual tab contains the following options:
Disabled Toggle on to block the input.
Placeholder Enter a placeholder text to show in the drop-down box by default. Disabled Toggle on to block the input. Searchable values
Toggle off to disable the auto completing option when entering characters in the drop-down box.
Calling an input value from a widget
For either type of input to work as a filter for a widget, the widget's query must reference the required input through a script. You must place the input script in the place the query references the values you want to filter by. Depending on the data to be entered in the input, you can use the following types of expressions:
|Query script||Sample widget query||Result|
Use this expression as a placeholder for whole queries, for example:
Just enter the required query in the input with ID Input0 and the widget will display the query results immediately.
The widget will represent all the events where the method is equal to the value entered in the input with ID Input0.
In this case, we must use
The widget will represent all the events from the data table entered in the input Select0 grouped by the period specified in the input Select1. See below how to populate the Select input drop-down list.
In this case, we must use
All widget and input ID values are assigned automatically and can be read in the Data settings of the widget or input element.
Using a text box type input
The Input type of input lets you enter any string value and so is a flexible option for creating a filter.
As said above, we can even use the text box type input as a way of entering queries for other widgets. For example, imagine that we want to be able to use a table widget as a sort of placeholder in our Activeboard and be able to easily change the query that feeds it. We can add a text box type input to the Activeboard and use it for query entry. Say the input's ID is Input0. The query that feeds the table should be
The following video shows an example of how to use the text box type input.
Using a select type input
Since this input creates a drop-down list, it works only with a limited number of possible values. To populate the list with values, click the input title bar and enter the values in the Data Source field by clicking Edit. You can populate the Select input list in a couple of ways:
By entering a fixed list of values. Below you can see the syntax you must use to populate the list with different values:
["a", "b", "c", "d"]
Using a query. Below you can see how the query used in the Data Source field of the input retrieves the values in the statusCode column.
query( from demo.ecommerce.data group by statusCode)
By default, you can only switch between the different values you have entered. To deselect a value and return to a neutral state, simply click on the drop-down list and hit the Esc key.
See how to use the Select type input in the following video.
Click the ellipsis button of an input to access the following options:
|Edit||Access the input configuration options.|
|Clone||Copy the input in the Activeboard.|
|Delete||Remove the input from the Activeboard.|
Show default data before entering values in an input
Widgets linked to an input (both the input and select type) don't show any data before you enter or select a value in the corresponding input. You can add the following pattern to the widget query to make it show the query data before selecting a specific value in the input.
isempty(input_reference) or input_script
For example, the following query can be used to show all the available method values in a specific widget before you enter a specific method to filter your data in the Input0.
query( from demo.ecommerce.data where isempty($Input0.value) or method = $Input0.value)
You can also use the following syntax to show a specific value in the widget before using the input:
In the following example, the Select0 input will show the email@example.com value by default before you select another value in the input.
query(from web.activity.all group every - by username where username=$(Select0.value|"firstname.lastname@example.org") select count())
You can use multiple inputs simultaneously to generate a widget able to display different sets of data with just a few clicks. Below are some examples that may help you better understand the potential of inputs.
Use the following query in a table widget to create a dynamic table that allows you to specify the source data table, the grouping period and the grouping key.
query( from $*Select0.value group every $*Select1.value by $*Select2.value select count() as count)
The table is linked to three different Select-type inputs populated with the following values:
["2m", "5m", "1s"]
The following capture shows the table after selecting demo.ecommerce.data as source table, 1s as grouping time and statusCode as key column for the grouping.
Feed a column widget with the following query to display the count of status codes greater than a specified value and grouped by a period selected from a list of values.
query( from demo.ecommerce.data group every $*Select0.value by statusCode where statusCode > $Input0.value select count() as count)
The Select-type input is populated with the following values:
["5m", "10m", "15m"]
The following capture shows the column widget after selecting 5m as grouping time and entering 400 in the free-text input, so that only status codes greater than 400 are shown. You must select the count field as the Y-axis value and add the statusCode column as a series in the Visual settings of the column widget.