How do I loop through connected records with Make?
Hey everyone! Welcome back to Build It with Tim. I'm excited to bring you another awesome video where we explore how to loop through connected records using Make in Tadabase. In this video, I'll guide you on how to achieve this functionality step by step.
The goal of this video is to demonstrate how to loop through connected records in Tadabase using Make, a third-party tool for connecting different services. Although we won't be connecting to external services in this case, we'll use Make to process data and submit it back to the database, allowing us to perform various behind-the-scenes operations.
First, I'll provide an overview of the finished product we'll be building. We'll have a template with five tasks, and when we create a new job, we'll select the template and automatically copy all the connected tasks to the new job. Although most of the action will happen behind the scenes, I'll show you the final result and then dive into the builder to explain the process.
Inside the builder, we'll have two tables: "jobs" and "tasks." The "jobs" table will have fields like job name, status, a roll-up field to count connected tasks, and a radio select field to identify if it's a template or not. It will also have a self-connection using the "job template" field. The "tasks" table will have similar fields and a connection to the "jobs" table.
We'll create a page with a form to add new jobs and a list of jobs. Additionally, we'll set up a record details page to view tasks connected to a specific job.
To achieve the looping functionality, we'll use Make. We'll start by setting up a webhook in Make to receive data from Tadabase. We'll create a mail hook module in Make, which will allow us to send data via email to Make. This module will receive the record ID of the newly created job in Tadabase.
In Tadabase, we'll add a text field to store the record ID, and a table rule to update this field with the record's ID every time a new record is created or edited. We'll then set up an email notification in Tadabase using a custom email. We'll include the record ID in the subject and send it to the custom mail hook address provided by Make.
With the webhook and email setup complete, we'll move back to Make. We'll retrieve the job record information using the record ID passed from Tadabase. This step allows us to access the template field value if a template is selected during job creation.
Next, we'll use Make's mapping feature to select the jobs table and map the record ID from the mail hook subject field. This mapping will pass the record ID to the next module.
At each step, I'll demonstrate the testing process, showing you the results and ensuring everything is working smoothly.
By following these instructions, you'll be able to loop through connected records using Make in Tadabase. This powerful functionality allows you to automatically copy connected tasks from a template to a new job, saving you time and effort.
I'm excited to guide you through this process and help you master looping through connected records with Make in Tadabase. Let's dive into the builder and get started!
Features Discussed:
-
Make (Time: 5:46)
Learn how to integrate and use Make (formerly Integromat) to automate workflows and connect apps. -
Webhooks (Time: 7:24)
Learn how to set up webhooks for real-time communication between your application and external services. -
Table Rules (Time: 8:18)
Learn how to configure table rules to automate actions based on data changes. -
Email Notifications (Time: 9:06)
Learn how to set up automated email notifications triggered by specific events. -
Connection Fields (Time: 10:46)
Learn how to effectively use connection fields to link related data records across different tables.
Transcript Summary
Introduction
Hey everybody, welcome back to Build It with Tadabase. I apologize for last week—I moved, as you can see from my new background. But I'm back, and ready to make some more awesome videos for you.
In today's episode, we're going to look at how to loop through connected records with Make.
What Is Make?
Make is a third-party tool that allows us to connect different services together. In this case, we're going to use it to process data behind the scenes and then submit it back to our database. We’re not connecting to any external services; it’s all within the database, but Make will help us do a lot of processing behind the scenes.
Final Product Overview
Here’s what our finished product will look like:
- We have a template already created with five tasks.
- When we add a new job, we select a template, find all the connected tasks, and copy them to the new job.
- For example, we can create a job called "Build a Web App for a Client," select our template, and when we save, the tasks from the template are copied over to the new job.
Setting Up the Foundation
I’ve already set up the foundation of the app:
- Jobs Table: Includes fields for job name, status, a roll-up field to count connected tasks, a radio select field to define if the record is a template, and a connection to the same jobs table for job templates.
- Tasks Table: Includes fields for task name, due date, status (select field), and a connection to the job record.
Page Setup
On the page side, we have:
- A form to add a new job
- A list of our jobs
- A record details page to view tasks connected to each job
How to Loop Through Connected Records
Using Make
- Creating a New Scenario: Start by creating a new scenario in Make, which is essentially our workflow.
- Setting Up a Mail Hook: We can use either a mail hook or a web hook to get our data from the database into Make. We'll start with the mail hook:
- Add a new mail hook module in Make.
- Give it a name like "Receive New Job Record from Email."
- The data we send will be the record ID of the new job we're creating.
- Setting Up the Database to Send Data to Make:
- Add a text field to the job record called "Record ID."
- Create a table rule to set the record ID in the text field every time a record is created.
- Use form email notifications to send the record ID to the custom email address provided by Make.
- Testing the Mail Hook: Run the scenario and create a test job to see if the data is received correctly by Make.
- Retrieving Job Information:
- Use the record ID to get the job information from the database.
- Search for tasks connected to the selected template.
- Creating New Task Records:
- Loop through the connected tasks and create new records in the tasks table.
- Map fields like task name, due date, and connection fields from the template tasks to the new tasks.
Using a Web Hook Instead
If you have a higher subscription level, you can use a web hook instead of a mail hook:
- Setting Up a Web Hook:
- In Make, add a web hook module instead of a mail hook.
- In the database builder, create an outgoing web hook to send the job data to Make when a new record is created.
- Running the Scenario: Similar to the mail hook setup, test the web hook by creating a new job and ensure that the tasks are copied over correctly.
We'd love to hear your feedback.