Skip to content

Variables

Variables are page (dashboard) wide parameters that allow you to pass information between components and create dynamic dashboards that update based on user input and selections.

Variables are set up at the page level by clicking on the “(x) Variables” button in the right hand pane, which is visible when the grid is selected (by clicking on any empty area in the grid).

A screenshot of a computer AI-generated content may be
incorrect.

This will bring up the Grid Variables form:

A screenshot of a phone AI-generated content may be
incorrect.

Clicking “Add variable” adds an empty variable configuration. The Name and Type fields are always present and the fields thereafter depend on the selection made in the Type field:

Name: Text input for the name of the variable. Must start with a dollar sign ($) and contain only letters and numbers. No spaces or special characters.

Type: dropdown to select where the value of the variable comes from. It has the following options:

Select: type a comma separated list of possible values directly in the variable configuration.

String: a text string entered into the variable configuration.

Select from Datasource output: The list of possible values comes from an Ingenuity data source.

Value from Datasource output: A boolean indicating if multiple values can be selected for this input.

Date: A boolean indicating if multiple values can be selected for this input.

Update URL: Enable this to update the URL with the selected value of the variable to create a link to the state of the page that can be shared.

The Select type variable lets a user select from a pre-defined list of options. These are typed as a comma-separated list in the “Possible values” field. For example,

Aa, Bb, Cc

A screenshot of a computer AI-generated content may be
incorrect.

To show a more user friendly name to the user, labels can be defined in square brackets before each variable:

\[Label 1\]Aa,\[Label 2\]Bb

For example, a list of possible airports with their codes would be defined as:

A screenshot of a computer AI-generated content may be
incorrect.

The user will see:

A screenshot of a computer AI-generated content may be
incorrect.

Use “Default value” field to define the value that will be selected the first time the page loads (and if there is no value passed in the URL).

The String type variable takes text input from a “Control” component and stores in in a page variable.

A screenshot of a phone AI-generated content may be
incorrect.

This is useful where the user is required to input text that is passed to an external data source, that cannot be pre-defined.

The example below uses a Control component to enter the data into the $myString variable and display it in a Text component

A blue rectangle with white background AI-generated content may be
incorrect.

This variable type takes the list of possible values from any of the installed data sources in Ingenuity. Much like the configuration of a component on a dashboard, the data source is selected from a dropdown list and the fields underneath will update to reflect the inputs and outputs from that data source.

A screenshot of a computer AI-generated content may be
incorrect.

Where the data source requires an input, this can come from other page variables (by clicking the (X) icon) or the Knowledge Graph (cube icon).

Variable name must be prefixed with ”$”

Section titled “Variable name must be prefixed with ”$””

The “Select from Datasource Output” type variable is an advanced variable that can contain a data object rather than a single value or string. Because of this, the variable name must be prefixed with a dollar sign ($). For example, “$foo”. If the variable name does not start with ”$”, the Control component connected to it will show

A close-up of a sign AI-generated content may be
incorrect.

The “Value from Datasource” type returns a single value for use in a component such as a Number, Level, Dial, Gauge etc. It is not used with a Control component.

A screenshot of a computer AI-generated content may be
incorrect.

The use case for this variable is to pass values to other variables.

Date type variables store a timestamp.

A screenshot of a login box AI-generated content may be
incorrect.

When connected to a Control component, users can select the data and time from a date picker:

A screenshot of a calendar AI-generated content may be
incorrect.

The default value has two options: “Static” and “Now”

A blue stripe on a white background AI-generated content may be
incorrect.

If “Static” is selected and the value field left blank, the date picker will start at 1^st^ Jan 1970, which is most probably annoying for users. Clicking in the field to the right of the dropdown will show a date picker and it is a good idea to set a date (and time).

A screenshot of a calendar AI-generated content may be
incorrect.

Selecting “Now” will show additional configuration options:

Offset: -1d for yesterday,

Default minute: [0 — 60] Set to 0 for the start of the nearest hour

Default hour: [0 — 24] Set to zero for midnight, 8 for 08:00 etc.

Default day: [1^st^- 31^st^, Last] Select the day of the month

For example, to default to midnight on the 1^st^ of the month:

Variable values are set by Control components or the value of other variables on the page.

The Control component will automatically adapt it’s display type to the variable type connected to it. For example, if a “Select” type is connected, the control will display a dropdown box. If a “String” type is connected, it will display a text input box.

A close-up of a computer AI-generated content may be
incorrect.

The example below is from our demo site:

https://ingenuity.eigen.co/pages/view/flights

Users can select an airport and see the live list of Arrivals and Departures

A screenshot of a computer AI-generated content may be
incorrect.

An “airport” variable is used to pass the selected airport to the FlightRadar24 data source.

Make sure the FlightRadar24 data source is installed and click the “Details” button:

A screenshot of a computer AI-generated content may be
incorrect.

Scroll to the Preview section at the bottom.

A screenshot of a computer AI-generated content may be
incorrect.

Enter an airport code (e.g. LHR for London Heathrow) and click Test.

A screenshot of a computer AI-generated content may be
incorrect.

Check through the Outputs to verify that the data source is working.

6.3.2 Configure the “airport” variable

Section titled “6.3.2 Configure the “airport” variable”

In Edit mode in your blank dashboard, click anywhere on the grid and then click the “Variables” button from the right-hand panel:

A screenshot of a computer AI-generated content may be
incorrect.

Click “Add variable”

A screenshot of a phone AI-generated content may be
incorrect.

Leave the Type as “Select” (this is the default)

Configure the variable as follows:

A screenshot of a computer AI-generated content may be
incorrect.

The complete list of airport codes can be found here: https://www.world-airport-codes.com/

Add a “Control” component to the page:

A screenshot of a phone AI-generated content may be incorrect.

Configure the control to use the “airport” variable under the “Format Value” section.

A screenshot of a phone AI-generated content may be
incorrect.

6.3.4 Configure a table to use the variables

Section titled “6.3.4 Configure a table to use the variables”

Add two “Data table” components to the page; one for the Arrivals and one for the Departures.

A screenshot of a computer AI-generated content may be
incorrect.

In the Source section of each table, select the FlightRadar24 data source. The input for the “code” will appear. Click the “(x)” icon on the right to connect this input to a page variable and select the airport” variable.

The table Source section should now look like this:

A screenshot of a computer AI-generated content may be
incorrect.

Add the following columns in the tables for the associated outputs from the FlightRadar24 data source [Type in square brackets]:

Time [Date]: Arrival Scheduled Arrival Time

Flight [Text]: Arrival Flight Number

Airline [Text]: Arrival Airline

From [Text]: Arrival From City

Terminal [Text]: Arrival Terminal

ETA [Text]: Arrival ETA

Status [Text]: Arrival Status Word

Time [Date]: Departure Scheduled Arrival Time

Flight [Text]: Departure Flight Number

Airline [Text]: Departure Airline

To [Text]: Departure Destination Name

Terminal [Text]: Departure Terminal

To display the time correctly, the Time column in both tables should be set to be a [Date] type. Then under the “Value” section the Source should be set to “Table” and “Use output” = the same as the column field (e.g. Arrival Scheduled Arrival Time)

Under the “Format” section the “Output” format should be “HH:mm”.

See the sections below: Type, Source, Use output and Output format

A screenshot of a computer AI-generated content may be
incorrect.

6.4 Worked Example — Theme Park Queue times

Section titled “6.4 Worked Example — Theme Park Queue times”

The example below is from our demo site:

https://ingenuity.eigen.co/pages/view/theme-park-queue-times

This page has two dropdown boxes where users can select the company and the park and see a list of the current queue times for all the rides.

A screenshot of a computer AI-generated content may be
incorrect.

Two variables are set up which reflect the name of the data returned from the source:

  1. $company — the id of the company

  2. $park — the id of the park

To follow this example, create a new Dashboard page in your own space.

This page uses the Theme Parks and Theme Park Queue Times data sources, which are configured against a publicly available APIs to return the list of theme park companies, the theme parks for that company and finally the queue times for the rides in that theme park.

A screenshot of a computer AI-generated content may be
incorrect.

Make sure these data sources are installed and then click the “Details” button against the Theme Parks data source:

A screenshot of a web page AI-generated content may be
incorrect.

Under the “Outputs” section we can see that the data source returns three outputs “Company”, “Parks” and “Details”.

Click the “Test” button to see the data that is returned:

A screenshot of a computer AI-generated content may be
incorrect.

Only the $company output is populated. If we expand it we can see there is a list of companies under the path $company.n (where n is a number from 0 to n) and each company has two properties; name and id

A screenshot of a computer AI-generated content may be
incorrect.

Take the id of the first company; 11 and enter it in the “Company ID” field

A screenshot of a computer AI-generated content may be
incorrect.

and re-test the output:

A screenshot of a computer AI-generated content may be
incorrect.

Now all three outputs have valid data. If we expand the $parks output, we can see that it has a list of parks under the sub path $parks.0.n (where n is a number from 0 to n). Each park has six properties. The ones we will be interested in are the name and id.

A screenshot of a computer AI-generated content may be
incorrect.

In Edit mode in your blank dashboard, click anywhere on the grid and then click the “Variables” button from the right-hand panel:

A screenshot of a computer AI-generated content may be
incorrect.

Click “Add variable”

A screenshot of a phone AI-generated content may be
incorrect.

Under the “Type” dropdown select “Select from Datasource output”

A screenshot of a computer AI-generated content may be
incorrect.

Name the variable “$company”. (Remember “Select from Data source” variable names must be prefixed with ”$”).

From the “Source” dropdown, select the “Theme Parks” data source. You will see that the form automatically updates to show the inputs for the data source. We do not need to set any inputs for this variable as we would like it to return all the companies.

A screenshot of a computer AI-generated content may be
incorrect.

Under the “Use output” dropdown, select the “$company” output

A white rectangular object with blue stripe AI-generated content may
be incorrect.

We do not need to set anything for the “Sub path” in this case because the list of companies is directly under the $company output (recall the data source test output in section 6.2.1).

The Label and Value fields determine what the user will see (the label) vs what the dashboard will use as the value.

From the test of the data source output we did, we know there are two properties for the company (name, id). Use the “name” property for the “Label path” and the “id” property for the “Value path”. This means that the dropdown will display a user-friendly list of names but will pass the id as the value when the variable is used.

We do not need to set a default value here.

Click on the “Add variable” button at the bottom of the form to add a second variable. Name this one $park and again set the Type as “Select from Datasource output”.

Select the “Theme Parks” data source again and under the “Company ID” input, click the “(x)” icon on the right to connect this input to one of the page variables; select the $company variable created in the previous step:

A screenshot of a computer screen AI-generated content may be
incorrect.

Select the “$parks” output from the “Use output” dropdown.

A blue line with black text AI-generated content may be
incorrect.

Remember that the data source test output (in section 6.2.1):

A screenshot of a computer AI-generated content may be
incorrect.

Because the output has the path $parks.0.n, we need to set the “Sub path” as “0”.

A screenshot of a computer AI-generated content may be
incorrect.

From the six available properties, we will use the “name” property under the “Label path” and the “id” under the “Value path”.

Save the Grid variables form and the page.

Add two “Control” components to the page:

Configure the first control to use the “$company” variable under the “Format Value” section:

A screenshot of a company profile AI-generated content may be
incorrect.

And enter the text “Company” in the “Format Label” section:

A screenshot of a computer AI-generated content may be
incorrect.

Repeat this for the second Control, but this time using the “$parks” variable. The controls should now look something like this:

A screenshot of a phone AI-generated content may be
incorrect.

6.4.5 Configure a table to use the variables

Section titled “6.4.5 Configure a table to use the variables”

Add a “Data table” component to the page.

A screenshot of a computer AI-generated content may be
incorrect.

In the Source section, select the Theme Park Queue Time data source. The input for the “PARK_ID” will appear below. Click the “(x)” icon on the right to connect this input to one of the page variables and select the “$Park” variable. In the “select” dropdown below the variable, select the “id” property.

A screenshot of a computer AI-generated content may be
incorrect.

The table Source section should now look like this:

A screenshot of a chat AI-generated content may be
incorrect.

Now configure the table in the normal way, making columns for the Ride, Land, Queue Time and any other fields you would like.

A screenshot of a screen AI-generated content may be
incorrect.

Save the dashboard.

If the Update URL switch is set to “on” for both variables, the current selection will be “remembered” in the URL to create a shareable link.

A blue and white switch with a white circle AI-generated content may
be incorrect.

For example, if a friend is at Disneyland in Florida (Company ID = 2, Park ID = 16) , you could send them this link:

https://ingenuity.eigen.co/pages/view/theme-park-queue-times?var%3A1715181299990=2&var%3A1715180655536=16

In this link, notice there is a ‘=2’ and ‘=16’