You've just learned how Data storage works. Now, let's finally see the real value of this feature. In this section, we will demonstrate a use case that some of us being on a forever-free Slack plan know very well.
Ever lost a message on Slack due to the fact that you're on a free plan? We did. Luckily for us and unluckily for Slack, there is a workaround. As tech geeks, we love workarounds, and we are somewhat proud to show you how to store Slack messages in the Appmixer Data storage so that there is never a message that is lost for good.
#sorrySlack
As you'll see, the flow we are about to build is more than simple. Below, see the overview of what it looks like once it's built-in Appmixer.
To get started hit the "Create Flow" button and drag & drop the Slack component to the canvas and choose either NewChannelMessage or NewPrivateChannelMessage – based on whether you want to store messages from public or private channels.
If you haven't authenticated your Slack account yet, now it's the right time to do so.
Next, you'll want to use the Storage module, or more specifically the "Set" component that saves new items to the Data storage. Below, see how we use a timestamp, message text and user to keep our database organised and clean.
We are all set! Except we aren't. There are for sure more channels from which we'd like to store messages in our Data storage. Let's adjust our flow a bit by adding more triggers / more Slack channels.
Next, we need to adjust the "Set" component a little bit. First, we need to choose the Data storage to which the messages will be saved. Second, we may want to use the channel name and timestamp as key...
... and the content of the message itself as value.
It's important to say that the Data storage needs to be first created in the "Storage" tab to further use it in a flow.
Let's do the same for other channels so that we store all messages, not only the ones coming into the "my-appmixer-tests" channel.
Now, every time a new message is sent to any of the Slack channels we've defined in the trigger components, the message gets saves to a Data storage.
Notice we have renamed the components according to the Slack channel name to keep our flow organised and self-explanatory.
You may wonder how the data looks once it's saved, don't you? Let's have a look.
You may note: "The timestamp is not in a format that is easily readable!" and you'd be absolutely right. You can easily adjust the date format using Modifiers, and make the data stored in Appmixer clear for anyone.
After that, you're all set! ✅
You just learned about the power of Data storage. In the next section, we'll look at Insights that help you keep track of your flows and data that flows between different platforms.
Now that you know what purpose Data storage serves and how to create one, let's go through the steps required to edit your Data storage.
There are a couple of things you can do with Data storage:
rename Data storage,
delete Data storage,
create or store a new item in Data storage,
delete items from Data storage,
clear Data storage.
Some of the actions can be executed in the Storage tab, others in the flow builder. Alternatively, you can edit Data storage via API.
To give you a full context, let's see at all the components that can be used in the flow builder.
OnItemAdded This trigger starts the flow when there is a new item added to a Data storage
OnItemRemoved This trigger starts the flow when there is an item removed from a Data storage
OnItemUpdated This trigger starts the flow when there is an item updated in a Data storage
Clear This action clears all data in a Data storage
Find This action finds an item in a Data store that can be used further in a flow
Get This action gets an item from a Data store to be used in a flow
Remove This action removes an item from a Data storage
Set This action sets a new item to a Data storage (being one of the ways to create new items in a Data storage)
Besides that, you can do some manual edits in the Storage tab like renaming or deleting Data storage.
Alternatively, you can edit Data storage via API. Read our technical documentation to find out more: https://docs.appmixer.com/appmixer/api/data-stores.
To see Data storage in action, let's read the next section and go through a pretty handy example.
Now that you know what purpose Data storage serves, let's create a new one for you! You'll see that the process of creating a new Data storage can hardly be easier.
We need to access the Storage tab in the Appmixer Studio to get started.
Next, click on the "Add Store" button.
You'll see a new Data storage was instantly created and is now ready to be used. You can either start saving data to your Data storage manually or by using the "Storage" module in a flow.
Alternatively, you can create Data storage via API. Read our technical documentation to find out more: https://docs.appmixer.com/appmixer/api/data-stores.
Simple, right? Let's see how to edit the Data storage like renaming and deleting.
The Appmixer Studio is not only about flows and accounts. One of the features that make your life easier is Data storage. Data storage is, as the name suggests, a way to store data inside Appmixer using the Key-Value database (it's like a table with two columns, key and value).
Data storage lives in the Appmixer Studio under the "Storage" tab.
By default, you can use the already-created "Default store". In our example, we store Order IDs and Order Values in the store.
It's important to note that Data storage is represented by the "Storage" utility module in the flow builder. The components in this module allow you to use triggers like:
OnItemAdded that triggers every time a new item is added to the data storage,
OnItemRemoved that triggers every time an item is removed from the data storage,
OnItemUpdated that triggers every time an item is updated in the data storage,
or actions like:
Clear that clears the entire data storage,
Find that helps you find values in data storage based on a Key text pattern,
Get that helps you get a value from data storage, and use it further in your flow,
Remove that removes a value in data storage,
Set that sets a new value in a data storage.
In the next sections, we will show you how to create and edit data storage, and how to use it in a flow.