In this post, I am going to repeat the same Knack automation that I had previously written about in the post(s) called Programming Knack with Integromat (which is now Make)...
The basic idea is that I have a database with two sets of tables - Process Templates / Template Steps and Processes and Process Steps:
In the example here, we have a template for starting up a new client project consisting ot 4 steps, each assigned to different people (a choice of Process Owner, Owner's Manager or a Specific Team Member). We are going to create a Flow which will set up the Process Steps when a user creates a new Process:
Creating the Flow
Flows are created in Knack in the Flows serction of the builder - the great thing here is that Flows automatically 'knows' about the structure of your apps so there is no need to create connections to your apps as would be required if you were to use Make.
The first step when creating a Flow is to decide on the trigger (the event in the app which will start the flow). In this case, I am going to trigger my flow when a new project record is created but you can trigger when forms are submitted etc.:
As you can see, you just have to select Knack as the source of the data, the type of event (Record Created) the app and the table. All straightforward!
The next thing we need to do is find the Process Template record which will be needed later on:
Here there are two pages in the set up - the first to select the table and then to set the record ID you are looking for.
Once this is done, you can then ask Flows to retrieve all the process steps from the Template Steps table - which we subsequently iterate through to create the steps for this particular project. This is similar to the previous action except we are searching by a field value (the linked Process Template):
There are several options available to you to search your records so if you are floowing this please take a look at them.
So, now Flows has a number of Template Steps records and we want it to go through (iterate) these and create a process step automatically and link it to the new process we created. The first thing we need to do is create an iterator to go through the retrieved records (if you are used to Make, this is automatic there but here we need to specify the iteration):
The iterator is found on the Tools options in Flows.
With the iterator in place, Flows will execute the following steps for each record retrieved for the particular template so the only additional thing we need to do is to set up an action to create the process steps:
There is one important thing to remember when using the Iterator which is to refer to fields for each record you are iterating through via the Iterator action itself (not from the Search for multiple records action. This is again a little counter intuitive for those of us used to Make but is easy to get used to.
And that's it!
Summary
I am getting a bit more used to Flows now - it's actually quite nice to have a built in feature which already understands your database. It works very quickly as well!
Further Information
If you would like more information about Knack click here.
If you would like more information about Make click here.
If you would like Flows added to your existing Knack account prior to general release you are able to make a request via a support ticket.
Comments