Introduction to Storage
Storage provides a mechanism for storing and retrieving of records (rows) during the execution of workflows. You can define unlimited number of different storage.
Storage concepts
Elementary piece of information stored in the storage is a record. Every record in the storage has a Record Key and a set of fields holding actual data. The Record Key (or just Key) is used to identify particular record to retrieve it from the storage. Each field in the record can store single value like text, number, date, price, link, etc.
If you’ve used Excel or any other spreadsheet, you have some idea what a whole storage might look like. Each record in the storage is one horizontal row in a spreadsheet that holds a set of cells. So, one cell represent one record field. Row number is the Key of a particular record.
For instance, we decided to have a list of customers who places orders for a particular good. For this case we choose user ID as the Key for records and use one field with item id which user have bought. Date of order will be stored for every record automatically.
Choosing the right Record Key
You need to specify a Record Key for any workflow action which will save records in the storage during execution the workflow. The Record Key may be any alphanumeric string or just any number. There is no special requirements or restriction on the Record Key except length. A maximum length is 200 symbols. The longer than this limit Record Key will be truncated to maximum length.
Note: Record Key cannot be empty, attempt to save a record with empty Record Key will generate an error and the record will not be stored.
In most cases you will use a unique Key. So, some recommendations may be: for storage related to registered users you may use {USER[ID]}
, for storage related to posts or pages it makes sense to use {$post[ID]},
for automotive related storage, which holds data about some cars, you may use car registration number.
Default Storage
Each workflow has one automatically predefined Default Storage you don’t need to create and configure it manually. This storage belongs exclusively to a particular workflow only and non of the other workflows can write or read records to/from this storage.
Default storage appears on the storage admin page after first record has been stored with action Save record.
Shared Storage
To operate with some storage cooperatively on a shared basis within many workflows, you need to use a common Shared storage.
Shared storage is a type of storage resource that is shared between and accessed by all of the workflows you have created on the website. Shared storage is intended for allowing simultaneous access by multiple workflows.
Before you can start using this type of storage you need to create it manually from within admin interface by clicking Create shared storage link on the Storage List page.
It’s recommended to use the identical Record Key in all actions which will store or retrieve records from a particular shared storage.
Default fields
By default the plugin saves Date/Time, User ID and IP address for every record. So, those fields already present in any storage and you don’t need to store it separately.
Admin interface
In the WordPress dashboard you can view and navigate through the records stored within selected storage and delete one record or all of them. There is ability to search in records fields and sort records by the Record Key, Date, User or IP address columns.
You can export all records from any storage as a comma-separated file (CSV) which will also include default fields.
You can give a name to the each columns and storage itself, configure columns to display and set another useful parameters.
It’s available to display last records from the selected storage as a WordPress Dashboard widget.
Storage FAQ
What cannot be saved as a field in a record?
Any list (array) or binary object like a file.
Limits?
- How many fields can have one record? Virtually unlimited.
- How many records one storage can store? Virtually unlimited.
- Is there any limit on size of field or record or storage? Virtually no limits.
Technical details
- Each record is stored as a MySQL table row with unique ID field which has integer data type. This field is not shown in admin interface.
- All record fields has UTF-8 character encoding.
- The Record Key field is stored as a separate VARCHAR field with up to 200 symbols length.
- All user specified custom record fields are stored in a separate TEXT field as serialized array.