Data Stores
Data Store module is a web interface for managing DB tables in WorkFusion.
You can use Data Stores to keep lookup tables for multi-value Answer options, save BP results, and query Data Stores from Bot Configs and Rules.
Data Stores options
To start managing Data Stores, go to the Data Stores tab.

You can perform the following operations with Records:
- add - create a new Data Store
- view and filter by column values; set columns to display in the grid
- edit - modify the data within Data Stores
- upload a new file
- if new file column names coincide with the Data Store columns, all new records will be appended to the Data Store
- otherwise, you need to map columns from the file to Data Store

- delete and delete all
Create Data Store
Click the Create Data Store button above the grid.

Enter a unique Name and Description to distinguish the Data Store. Name can contain alphanumeric characters, underscores, and spaces only.
To define the Data Store structure, upload the table file. For that, click Upload File and select a .CSV file, the first line should contain column headers.
To upload, clicking the Add button and select the file on your machine.
caution
You cannot select another source CSV file after saving the Data Store.
Column names cannot contain spaces.

As soon as the file is uploaded, click Upload.

Click Save.
Filter Data Stores
For quick navigation through Data Stores, you can use filters.

There are two types of filters:
- Predefined - you can filter out the Data Stores created by you
- Advanced - you can set a number of criteria for the filter

To add a parameter to your filter, use the Select an Option dropdown. As the first parameter has been added to the filter, you can add or delete the parameters using plus (+) or minus (-) sign.
- Name - text the Data Store name contains
- Description - text the Data Store description contains
- Author - name of the user who created the Data Store
tip
With Name and Description, you can use the contains / does not contain or equals to / not equals to options.
In the Author field, you can specify a number of authors and define the contains / does not contain options. Additionally, you can use Match All of The Following to match the search results with the all options defined in your filter.
Edit Data Store
To enter any changes in a Data Store, do as follows.
- Click the appropriate Data Store name in the grid.
- Hover over a record number and click the Edit button that is available on hovering.

You are able to edit both the Configuration and Data tabs.

- On finishing, click Save.
Delete Data Store
To perform a bulk Data Store deletion, do as follows.
- Go to Campaigns > Data Stores.
- Tick the appropriate Data Stores in the grid.
- Click the Delete button and confirm this action.
You can also delete a separate Data Store from the Data Store Details page.
- Go to the Data tab.
- Click the Delete Data Store button in the bottom right corner and confirm this action.
Work with Data Stores
Answers
You can use a Data Store to create a reusable lookup list for Task Answer, e.g., List of Countries.
Instead of adding options manually, you can use Records from a Data Store for the following Answer Types:
- Free Text
- Select Multi
- Select One
- Check One
- Check Multi
- Taxonomy
Tick the Input from Data Store checkbox and select an item from the list.

To use a predefined list in Answers, you need to create a Data Store with two columns:
- id - unique identifier
- name - label to show in the dropdown
note
All currencies that can be used as an answer for the Currency Answer Type in the Information Extraction Answer Type are stored in a system Data Store called System Currency. In the Data Store, the currency code represents the currency id and name contains the currency code and name.
Business processes
To automatically load the BP Final Results to a Data Store, tick the Copy results to DataStore checkbox. Therefore, you do not need to generate a BP Snapshot and store it on your local computer or in the cloud.

note
If a Business Process uses Data Stores in its steps, the Data Stores can be included to the package during the export procedure and created in another Control Tower as the package is imported. More details you can find in Migrating Packages of Tasks and BPs.
Global variables
All the global variables are stored in one Data Store with the Global Variables name. You can use these variable values in the <var-global> plugin.
Manual Task
You can develop a custom Manual Task that uses Data Store API calls from JavaScript. In such Manual Tasks, you should create a set of Data Store Queries.
Rule
You can query a Data Store from a Rule:
String query = "SELECT * FROM @This WHERE color = '" + answer.getFormInputValue() + "';";
List<Object[]> prohibitionRecords = ruleContext.queryDataStore("Prohibited Colors", query);
Performance optimization
Data Store functionality is implemented using relational database under the hood. In order to optimize performance for significant amount of data, a developer need to think about indexes.
There are two ways of managing Data Store indexes:
- set up indices within the Bot Task code
- contact your Operations team to create index in PostgreSQL with the given table and index details
Archive and audit
All actions with Data Stores are tracked in DB in a special Audit table (data_store_audit). It is accessible only from DataBase.
Removed records are saved in a special DB table with _archive postfix and can be restored only via DB (e.g., for "ds_test" table, archive is located in "ds_test_archive" table).
After deleting, a deleted datastore is not removed from DB completely, an archive table is created instead (e.g., "ds_currencies" will be renamed to "ds_currencies_del20160129022959"). The archived table with removed records is not removed and marked as "deleted" as well (ds_currencies_del20160129022959_archive).
Database limitations
As Data Stores technically represented as database tables, there are some limitations related to DataBase version. For more details, see the table below.
| Limit | Value |
|---|---|
| Maximum table size | 32 TB |
| Maximum rows per table | unlimited |
| Maximum columns per table | 250-1,600 depending on column types |
| Maximum indices per table | unlimited |