Table of Contents | ||||
---|---|---|---|---|
|
Widgets linked to an input (both the input and select type) do not automatically show data before you enter or select a value in the corresponding input. However, you can make it happen by adding a specific syntax to the widget query.
Show a specific value
This is possible with both types of inputs, as well as any of the operations accepted in the use of inputs (see them in this article).
In the widget query, adding this pattern (|"specific value"
) right after the input reference (InputID.value
) will make the widget show a specific value of your choice before entering or selecting one in the input.
When using the $ or $* operators, the input reference and the predefined value reference must be enclosed within brackets after the operator.
...|"specific value"
→
InputID.value|"specific value"
$(InputID.value|"specific value")
$*(InputID.value|"specific value")
For example, the query on the left is used to call the username value from Select0 and can be transformed into the query on the right to show the username value john@devo.com before you select one.
Without Example without predefined values
Code Block |
---|
query(from siem.logtrust.web.activity where username = $Select0.value group every - by username, method select count()) |
With Example with predefined values
Code Block |
---|
query(from siem.logtrust.web.activity where username = $(Select0.value|"john@devo.com") group every - by username, method select count()) |
Show all possible values
This is possible with both types of inputs, however, it is only possible with operations to filter data.
In the widget query, adding the following pattern after the where
operator will make the widget show all possible values of the filtered field for the query and time range specified. This is helpful to show all data before start filtering for a more holistic view of each filtering criteria in contrast to the total.
...isempty(InputID.value) or... → where isempty(InputID.value) or field = $InputID.value
For example, the query on the left is used to call the method value from Input0 and can be transformed into the query on the right to show all the available method values before you enter one.
Without Example without predefined values
Code Block |
---|
query( from demo.ecommerce.data where method = $Input0.value) |
With Example with predefined values
Code Block |
---|
query( from demo.ecommerce.data where isempty($Input0.value) or method = $Input0.value) |
Note |
---|
Multiple selection in select inputs When using select inputs and enabling the multiple selection option, the syntax must be adjusted as explained in the article Case-specific adjustments. Otherwise, you will get an error and your widget will not display data. |