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:
- Combine several forms in the same dashboard. See Combine indices.
- Use another date for the time range, such as a date question from the form instead of the collection date. See Time field.
- Separate views of the same index, for example a data source with its own labels and formats for an executive dashboard.
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
- Open ☰ → Stack Management → Data Views.
- Click Create data view.
- Fill in the fields:
| Field | What to enter |
|---|---|
| Name | The name shown in the data source selector. Use a readable name, for example "5S Audit" or "Best Practices – All Divisions". |
| Index pattern | The 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 field | The date field that controls the time range. In most cases, date, the collection date. See Time field. |
- Check, in the list on the right, that all expected indices appear, and only them.
- Click Save data view.
Index pattern
The Index pattern field accepts the exact name of an index, a wildcard (*) or a comma-separated list:
| Pattern | What it matches | When to use |
|---|---|---|
21261-personal-data-form | Only that index | One form. |
*best-practices* | All indices with "best-practices" in the name | Several forms with a common part in the name. |
21540-audit-site-a,21541-audit-site-b | Exactly the indices in the list | A few forms without a common part in the name. |
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
_indexfield 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.
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 field | What it means | When to use |
|---|---|---|
date | The collection date | The default for almost every dashboard. |
| A date question from the form | The 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. |
| None | The data source has no time range | Rarely. Without a time field, the time picker does not apply to charts. |
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:
| Icon | Type | What you can do |
|---|---|---|
| # | Number | Sum, average, median, minimum, maximum, percentile, group into ranges. |
| k | Exact text (keyword) | Group, count values, filter by exact value, unique count. |
| t | Free text | Search for words. Not suitable for grouping: use the .keyword version. |
| Calendar | Date | Time range, date grouping, date filters. |
| Globe | Location | Maps, 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.
_asText suffixSome 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.
- Open ☰ → Stack Management → Data Views and click the data source.
- In the field list, click the field's pencil icon.
- Adjust the options:
| Option | What it does | Example |
|---|---|---|
| Set custom label | Shows a readable name instead of the technical name | perc-total-5s → "5S Total (%)" |
| Set format | Defines how the value is displayed: number with decimals, percentage, duration, date and others | Time in seconds displayed as "5 min 12 s" |
| Set popularity | Moves the field higher in the lists | Most used fields at the top |
- Click Save.
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:
- Check that the question has a name and is enabled for export in the integration.
- Submit a test collection answering the question.
- 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.