Skip to main content

Data sources

The data source is the bridge between charts and collections. It tells which forms the data comes from, which date controls the period analyzed and which fields are available for charts. With a well-configured data source, whoever builds the dashboard finds fields with clear names, numbers already formatted and the time range working as expected. The data source is also what lets you combine several forms, for example one per site or per division, to compare them in the same chart.

On screen, the data source is called Data view.


When to create a data source​

In general, every integrated form already has a data source available. Create a new one when you need to:

  1. Combine several forms in the same dashboard. See Combine indices.
  2. Use another date for the time range, such as a date question from the form instead of the collection date. See Time field.
  3. Separate views of the same index, for example a data source with its own labels and formats for an executive dashboard.
Check before creating

In the chart editor and in Discover, the selector in the top left corner lists all available data sources. Check whether one already exists for the form before creating another, to avoid duplicate data sources with similar names.


Create a data source​

  1. Open ☰ → Stack Management → Data Views.
  2. Click Create data view.
  3. Fill in the fields:
FieldWhat to enter
NameThe name shown in the data source selector. Use a readable name, for example "5S Audit" or "Best Practices – All Divisions".
Index patternThe index name, or a pattern that matches several indices. See Index pattern. On the right, the screen lists the indices that match the pattern typed.
Timestamp fieldThe date field that controls the time range. In most cases, date, the collection date. See Time field.
  1. Check, in the list on the right, that all expected indices appear, and only them.
  2. Click Save data view.

Index pattern​

The Index pattern field accepts the exact name of an index, a wildcard (*) or a comma-separated list:

PatternWhat it matchesWhen to use
21261-personal-data-formOnly that indexOne form.
*best-practices*All indices with "best-practices" in the nameSeveral forms with a common part in the name.
21540-audit-site-a,21541-audit-site-bExactly the indices in the listA few forms without a common part in the name.
Wildcards that are too broad

A wildcard such as *audit* may match indices that shouldn't be in the dashboard, such as a test form or another kind of audit. Always check the list of indices on the right before saving. If an extra index appears, replace the wildcard with a comma-separated list.


Combine indices​

A data source with several indices treats all collections as a single base. Fields with the same name in every form become a single field, and charts can sum, compare and group everything together.

For this to work, the forms must be standardized: same question names, same question types and same answer options. See Combine several forms in one dashboard.

The _index field​

Every data source has the _index field, with the name of the index each record came from. It is useful to:

  • Check that all forms are in the data source. In Discover, click the _index field in the field list: the index names appear, with the number of records in each.
  • Split the forms in a chart when there is no identification question. Use the Filters grouping, with one filter per index:
Filter (search bar)Label
_index : *site-a*Site A
_index : *site-b*Site B
_index : *site-c*Site C

See Filters grouping.

Prefer an identification question

The _index field shows the technical index name, such as 21540-bp-division-a. A fixed-value question in each form (for example, division) shows readable names in charts and filters, without building one filter per index.


Time field​

The time field defines the date used by the time picker and by date groupings (month by month, week by week).

Time fieldWhat it meansWhen to use
dateThe collection dateThe default for almost every dashboard.
A date question from the formThe date entered by the respondent (for example, the date of the visit or of the incident)When the collection may happen after the fact, and the dashboard should show the date of the fact.
NoneThe data source has no time rangeRarely. Without a time field, the time picker does not apply to charts.
Changing the time field changes every chart

The time field can be changed when editing the data source, but the change affects the time range of every chart that uses it. If only one dashboard needs another date, create a new data source with the desired time field.


Field types​

The field list shows an icon for each type:

IconTypeWhat you can do
#NumberSum, average, median, minimum, maximum, percentile, group into ranges.
kExact text (keyword)Group, count values, filter by exact value, unique count.
tFree textSearch for words. Not suitable for grouping: use the .keyword version.
CalendarDateTime range, date grouping, date filters.
GlobeLocationMaps, when the collection has a location.

.keyword fields​

Text fields may appear twice, for example region and region.keyword. The .keyword version stores the exact text and is the one to use for grouping (top values, breakdowns) and for dashboard controls. The version without the suffix is for searching words inside the text.

The chart editor usually picks the right version on its own. When choosing manually, prefer .keyword for grouping.

Fields with the _asText suffix

Some fields also appear in a version with the _asText suffix, which holds the content of the same field as text. To group, filter and calculate, use the main field. If the two show different values, compare them in Discover before choosing.


Field labels and formats​

In the data source, each field can get a label and a format. They apply to every chart, table and to Discover, with no need to adjust chart by chart.

  1. Open ☰ → Stack Management → Data Views and click the data source.
  2. In the field list, click the field's pencil icon.
  3. Adjust the options:
OptionWhat it doesExample
Set custom labelShows a readable name instead of the technical nameperc-total-5s → "5S Total (%)"
Set formatDefines how the value is displayed: number with decimals, percentage, duration, date and othersTime in seconds displayed as "5 min 12 s"
Set popularityMoves the field higher in the listsMost used fields at the top
  1. Click Save.
Labels in the data source, titles in the chart

Use data source labels for names repeated everywhere (question names). Use the metric name in the chart for what is specific to that chart ("Monthly average", "Year-to-date total"). See Formatting and style.


New fields that don't appear​

A field only appears in the data source after at least one collection contains it. After adding a question to the form:

  1. Check that the question has a name and is enabled for export in the integration.
  2. Submit a test collection answering the question.
  3. Reload the Discover or chart editor page.

If the field still doesn't appear, check whether the test collection reached the index (see Explore the data) and whether the selected time range includes the collection date.


Edit and delete​

  • Renaming a data source doesn't affect charts.
  • Changing the index pattern changes the data of every chart that uses that data source.
  • Deleting a data source breaks the charts and dashboards that depend on it. Before deleting, check that it is not in use.