Calling an input value from a widget
Introduction
Both types of inputs can be used as variable elements for widgets. The widget's query must reference the required input through a script placed in the part of the query you want to substitute with the input values. This script consists of the input ID and the value suffix joined by a dot (InputID.value)
and can be accompanied by an operator depending on the function the input values fulfil inside the query.
All widget and input ID values are assigned automatically and can be read in the Data settings of the widget or input element.
Depending on the data to be entered in the input and their function inside the widget query, you can use the following types of expressions and operators:
| |
---|---|
Use this expression in the widget query as a placeholder for whole queries. Example query(Input0.value) | Enter the required query in the input and the widget will display the query results. In the example on the left, a valid option would be:
|
| |
Use the Example query(from demo.ecommerce.data
where method=$Input0.value) | Enter the required filtering options in the input and the widget will display the result of the filter operation. In the example on the left, some valid options would be:
|
| |
Use the Example query(from $*Select0.value
group every $*Select1.value
by $*Select2.value) | Enter the required query part or field in the input and the widget will display the results. In the example on the left, some valid options would be:
|
These expressions will make your widgets show data according to the content introduced in the inputs referenced in their queries, however, they will not show anything until the input contains valid values. If you want them to show content prior to manual selection, you can further configure them as explained in the following article: Show data in widgets before entering values in inputs
Examples
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.