Blog • Developer

Introducing new Flow querying

Last updated: 24 Jun 2019

This information is specific to the deprecated version one. For more up-to-date details, see our API Reference.

Today we’re introducing a new way to query Flows, allowing you to do much more advanced queries, including cross-flow querying and array checks.

For a long time, we've been asked by a large number of our community if there was a way to do more advanced queries on our Flows. We spent a lot of time looking at what would be needed and how to implement an elegant solution that was backward compatible. There was a good chance that any system we implemented wouldn’t work with our SDKs or could break existing projects. The solution we came up with was to use our existing URL structure but to add more flexibility to it. There are now a number of operators that can be used as part of the column, for example:

# Equals
products?title=Real+Product

# Does not equal
products?title!=Example+Product

# Greater than
products?price>=49.99

# Less than
products?price<=99.99

And of course, you can chain all of these methods into one query.

products?price>=49.99&price<=99.99&title!=Example+Product

You can now also do "like” and "not like" queries to make searching on titles, slugs and descriptions much easier.

# Like
products?title*=Chair

# Not Like
products?title!*=Sofa

As well as this we introduced the "in" clause to allow you to check if your column is in an array of items:

products?category=in('618', '614')

Using IDs isn’t always the nicest way to go about doing things so we wanted to make it easier. To do this we enabled cross-flow querying, meaning columns within a relationship can now be queried. You can now tie together search queries for attributes, custom options and more, all by using the dot separator.

products?category.slug=featured

Again everything can be chained into one complex query:

products?title*=Chair&category.slug!=in('sofa', 'chair')&price>=49.99&price<=99.99

While these examples are all using products, they will work on any flow - including custom created flows.

These arguments are now available in version one of the API and we're really excited to see what you guys do with these!

Save Your Seat! Magento Migration Considerations

Discover best practices for migrating off of M1 from a Magento certified partner and decide if M2 is right for you.

From Our Blog

20 Jun 2019

Analytics for your Moltin store

Today we’re going to take a look at how to use best-in-class data warehousing and analytics solutions on top of Moltin, specifically in relation to orders and order items.

Read More
author
Matt Foyle
9 min. read in Developer
19 Jun 2019

Further Flows improvements

We've been working hard recently to improve the developer experience when using the Moltin API to build an online store.

Read More
author
James Owers
9 min. read in Announcements | Developer
29 May 2019

What to consider when migrating eCommerce platforms

Even though you are well aware of the pitfalls of your current eCommerce platform - be it rigidity, technical debt or the inability to innovate quickly; the thought of re-platforming can be a scary...

Read More
author
Joanna Suau
9 min. read in Magento Migration | Developer | eCommerce