A Data Store is simply a key-value pair stored in the database that is available to all records in the system.
Use Data Stores to easily make variables persistent and retrievable.
This is particularly handy in a uni-directional integration where polling the remote system is necessary. You can store data such as:
- The last time a request was made
- Identifiers that have been seen before
setDatato work with simple string-like data.
// Store the current log count
var log_count = bond.getData('log_count');
bond.setData('log_count', parseInt(log_count, 10) + 1)
You can also work with objects just as easily by using
// Store the logs that have been seen
var logs_seen = bond.getDataObject('logs_seen'); // [1375, 1399, 1748]