Moltin is constantly looking at ways to ease the cumbersome process of onboarding, making it as user-friendly as possible.
As part of this endeavour, last month, we added pagination to Flow entries in our API, and today we are proud to announce that this feature has made its way into Moltin dashboard.
What are Flows and why do I need them?
If you still haven't heard of Flows, take a look at our website that will walk you briefly through the concept and help you understand why Flows is a crucial part of any commerce project.
In the nutshell, Flows allows you to add custom data to your Moltin project. With Flows, you are able to create various types of fields, including strings, booleans, dates, integers and relationships with other custom Flows. Why is it important? With Flows, you are able to apply Moltin to almost any use case you can think of.
If you wish to store extra fields per product, such as date of manufacture for customers or a string field to store a color hexadecimal for the product for use in the UI, you'll want to extend the products resource.
Flows also allows you to create new resources to power things like product reviews, wish lists, blog articles, staff profile pages, and many more.
The sky’s the limit here.
When we talk about Flows, we need to talk about Fields and Entries as they are an integral part of them. A Flow object describes a collection of Fields, whereas a Field represents a single field of data. An Entry is a specific instance of a Flow, and is associated with a specific instance of an entity (for example, a single product). Entries for core Flows (existing resources) are managed automatically for you.
So to put it simply, Flows objects are like tables in a database. Fields are like columns whereas Entries are like database records.
What can I do with Flows in the dashboard?
Even though Flows has been added to the Moltin dashboard, they still have a long way to go before we migrate the entire functionality you can see in the API. For example, even though you can currently use the dashboard to create custom data, you cannot create relationships between the data, which would still need to be added through the API. On the bright side, dashboard takes away from you the hassle of creating entries when adding new resources. These are automatically added to dashboard once they’re created, whereas if you were to do this through the API, you would have to add and manage entries yourself.
Below, we’ve gathered all major features that make Flows so powerful to show which are still API-specific and which can be used through dashboard.
|Flow feature||Moltin API||Moltin dashboard|
|Extend an existing resource||V||V|
|Create a new resource||V||V|
|Add a field||V||V|
|Add and manage entries for new resources||manual||automatic|
|Create a relationship between data||V||X|
|Support for date fields||V||X|
|Input type validation||V||V|
Setting the Flows in the dashboard
Flows has been available in the Moltin dashboard for some time now, but until now, we’ve never really discussed how much you can actually do with Flows in the dashboard.
There are two scenarios for using Flows:
- Extending an existing resource (e.g.
- Adding a new resource to create a custom feature that otherwise wouldn’t exist on the Moltin API (e.g. blog, wish list, etc.).
Let’s start with where to set them up. Basically, all you have to do it go to Settings > Flows and add a new Flow by filling in all mandatory fields. Make sure your Flow is enabled so you can use it to create Fields you wish to add to your project. In this example, we’re going to extend an existing resource
product by adding some more manufacture detail, in this case the date and place of manufacture.
Typically, new Flows will appear in the left-hand navigation bar under Flows. However, when you’re extending an existing resource, Fields you’ve created will automatically appear for each extended resource. An important thing to remember is to use the plural version of the resource you want to extend, e.g. orders, products, cart items, etc. We cover adding a Field in the next section.
Add a Field
Now we have our Flow, we can create as many Fields for it as we need. In this case, we’re just going to add one Field, “Manufacture Date” that will appear for every product in the catalog under Custom Fields section at the bottom of your product view page.
About the Add a new field form:
- Enable the Unique checkbox, if you want each Entry this Field will contain to be unique.
If you have added a new resource, typically, you’ll need to take care of the Entries as well. You can add Entries directly through the dashboard too. To add an Entry, you’ll need to access the Flow you’re interested in from the left-side navigation bar. There, you can view all Fields already available for that Flow. Each Field can have an unlimited number of Entries. Click the + New Entry button and provide the name of the Entry. All Entries will fall under the Field you’ve chosen, creating a hierarchical tree that’s easy to review.
However, for existing resources, an Entry is created as soon as the Field is used. In the case of our product’s manufacture date, as soon as the date is filled in for each product, all this data will be automatically recorded as Entries.
Flow Entries pagination and why it’s important
- Important for the API
Pagination is extremely important for stores that generated numerous entries and are trying to build them in the API within one response. Pagination allows for quicker response time on-build and makes large amounts of data more manageable and user friendly.
- Important for the dashboard
In terms of the dashboard, adding pagination to the view is helpful to restrict the number of records visualized on the initial page load, making your dashboard faster to use. It is also easier to visualize your Entries page by page rather than scrolling through numerous entries.
Now you’ve seen how important Flows are to the entire Moltin API infrastructure and how easy it is to set them up in dashboard, feel free to experiment on your own, or do some further reading. Here’s the list of existing resources you can expand with Flows. We are constantly adding to and improving this vital feature, so keep your eyes peeled on the upcoming updates!