Datastore
Build and use a datastore to keep your data for easy reuse.
Last updated
Was this helpful?
Build and use a datastore to keep your data for easy reuse.
Last updated
Was this helpful?
You can use datastore for use cases like listing active users, managing workspace settings, lookup tables and others. Data from a datastore can be fetched using its name space by a specialist Make module or through API. The key specifications for datastore interaction include:
authentication through Magic Links
support for CSV data files
supported text search
The steps below demonstrate an example how to use the datastore functionality and test it with the end-to-end flow:
Start with populating a datastore through the Set a Datastore from a CSV Upload module in Make. The supported file format for the data is CSV. To pull the CSV file, you can create a scenario in Make with relevant modules.
For example, for fetching the file you can use the HTTP module and then link it to the Set a Datastore from a CSV Upload module.
Add a URL to your file in the HTTP module.
Configure the Set a Datastore from a CSV Upload:
Add a name for the Namespace - it's used for organizing and separating data, it binds the data extracted from the CSV file, for example: active_users
.
Enter the name of the Key Column, it's the key for each imported entity, for example: id
.
Select the HTTP - Get a file option.
Run the scenario, it populates a datastore with all the information from the uploaded file, for example with active users. By default, there are up to 100 entries that are displayed in the response, but the datastore can include more than that.
A common use case is to use datastores to populate select boxes in forms - create a form to access the values from the datastore.
Go to Management Dashboard -> OE -> Forms and choose Create form.
Choose the Dropdown list component and go to the Data tab.
Choose URL for the Data Source Type and paste the URL in the Data Source URL field. The variable in the URL is your datastore name from the Set a Datastore from a CSV Upload module, for example: https://api.emporix.io/.../data-store/active_users/values
.
Add the Request Headers:
First - key: X-Magic-Link
, value: _MAGIC_LINK_ID_
.
Second - key: X-Tenant
, value: _TENANT_ID_
.
Add the Search Query Name - it's used for refining the results, for example: search
.
Leave the Search Threshold with the 0,3
value.
Datastores are authenticated with Magic Links. You can add the Create Form Magic Link ID module in a Make scenario and in the Included Forms select the form that you'd prepared for the datastore search. The module creates a link to the form that is used in the List Values in a Datastore module. You can add it in the same scenario or create a new one only for searching the data.
Add the List Values in a Datastore module.
Enter the Namespace that was set up in the Set a Datastore from a CSV Upload, in our example it was active_users
.
Choose the Magic Link ID from the Create Form Magic Link ID module.
Choose the search type, for example, you want to search for users called Nathan.
Add a limit for your search, for example, you want to limit the number of active users called Nathan to 250 results.
Run the scenario. If the run is successful, you can see the search results in bundles, in the List Values in a Datastore module output. See the returned demo data:
The search behaviour is a text match, if the first name is the same as the last name, or a part of it, the search returns results for both.
Whenever you want to update the stored data, simply upload a new file with the changes. After a new upload, the old data is overridden with new one. To remove all the data, upload an empty file.
The whole example can be viewed in a following flow, but it can be also separated to upload data for the datastore only (with the Get a File and Set a Datastore from a CSV Upload modules), and later to search for data within the configured datastore (with the Create Form Magic Link and List Values in a Datastore modules).
To check the Make modules, see the documentation.
To learn more about forms, see the documentation.