How do I find similar records?
Hey there, Tadabase users! Today, I have a quick tip for you on finding similar records. In this video, we'll use data source filters, a details page, and a table component to achieve this. It's a simple and easy process that will only take a few minutes to set up.
First, let me show you what the finished application looks like. We have a contacts table with 228 records, and we want to find similar records based on the first name field. We also have a way to exclude a specific record from the duplicates. For example, if we click on a person named James, it will show us other people with the same first name, excluding the selected record.
Now let's dive into the builder and get started. Keep in mind that this method is best suited for finding similar records based on a single field value. If you have a more complex application where you want to check multiple fields together, this solution might not work.
In the data table of contacts, we'll create a page called "Contacts" and add it to our menu. On this page, we'll use a table component with a details page. We'll enable the search option so that we can easily find the potentially similar records.
On the details page, we'll add another table component and choose the same data table as before. We'll add the same fields and then go to the data source filters. Since we're on the details page, we can reference the field values of the selected record. In this case, we'll check if the first name matches the current record's first name value.
Now, when we preview the page and search for a specific name, such as John or James, it will display all the records with the same first name on the details page.
However, there might be some issues with this method. For example, if we have multiple records with the same first name, the selected record will still appear in the similar record list. To overcome this, we can use a text formula to create a unique string combining different fields. We'll call this formula "unique string" and concatenate the first name, last name, company, and app name fields with hyphens.
Next, we'll edit the data source filter on the details page and add another condition to check that the unique string is not equal to the current record's unique string value. This ensures that the selected record is excluded from the similar record list.
And that's it! With these tricks, you can easily find potential similar records in your application. You can experiment with different fields, like email or date, and adapt this method to your needs. Additionally, you can explore various ways to manage these similar records, such as flagging them with a status field or merging them together.
I hope you found this tip helpful. Stay tuned for future videos where we'll cover more advanced topics. Thank you for watching this episode of Build It with Tim, and I'll see you next week!
Features Discussed:
-
Details Page (Time: 3:00)
Learn how to configure and utilize a details page to display specific record information. -
Table Component (Time: 3:48)
Learn how to set up and customize table components for data presentation. -
Data Source Filter (Time: 4:04)
Learn how to apply data source filters to refine the data displayed in your components. -
Text Formula (Time: 6:00)
Learn how to use text formulas to manipulate and format text within your application.
Transcript Summary
Introduction
Hey everybody, where I take your ideas and suggestions for fun things to build or anything you have questions on, and I'll build it live and on the fly. Today's video is going to be a quick one—a little tip for finding similar records.
We're going to use data source filters, a details page, and a table component to do this. The table component could be swapped out with a list component if you prefer, but I've chosen the table component for no particular reason. Before we dive into the builder, I'll show you what this looks like when it's finished. Like I said, it's going to be quick and easy.
Demo Overview
Here is our demo of the finished application. This isn't so much of a real application as it is a helpful trick to find similar records. You can see we have 228 records in our contacts table, and right off the bat, we can see a couple of people with the same first name. In this example, we're checking based on the first name rather than any other field.
If I click on this "James," you'll see it shows me other people with the same first name as James, but it excludes this specific record. It's pretty simple and should only take a couple of minutes to set up, so let's hop over to the builder and take a look.
Setting Up the Builder
Before we get started, I want to preface this by saying this is a pretty simplistic method for finding similar records. It works based on just a single field value—in our case, the first name. If you have a more complex application where you want to check connections or multiple fields together, this solution might not work. But for simple cases, it will work to find and display similar records, and then you can build a way to manage those potential duplicates or similar records.
Creating the Contacts Table
As you can see, I have a data table of contacts. I made a fake list of names, companies, and app names and imported them into the builder. We have fields for first name, last name, company, and app name.
Adding a Contacts Page
We'll go to the page builder and add a new page called "Contacts." We'll add it to our menu and use a table component for the contacts with a details page.
Enabling Search and Adding a Details Page
On this table component, I'll enable search because I know which records are potentially similar, and I want to search for those to show you. The details page will show more information about a selected contact record. We'll add a new row and column on the details page, then add a table component to show contacts again. We'll choose the same data table as before.
Adding Data Source Filters
Now, I'll go to data source filters. Since we're on a details page, we can reference field values of the selected record we're viewing. For example, if we're looking at the details of Tim Young, we can reference the field values for that record in our data source filters. We'll set the filter to show records where the first name matches the first name of the current page's record.
Preview and Testing
I'll preview this page. Let's search for "John." You can see there are a lot of Johns. If I go to the details of one, it shows all the other people with the same first name. The same goes for "James." If I select a James, it shows me the other James records on the details page.
Handling Duplicate Records
There are some issues with this method, such as showing the same record in the similar records list. We can work around this by using a text formula to build a unique string and check that string in the data source filters.
Creating a Unique String
I'll go back to the contacts data table, add an equation for a text formula, and call it "Unique String." We'll concatenate the first name, last name, company, and app name with hyphens. This creates a unique combination of these four fields.
Updating Filters with the Unique String
I'll edit the table on the details page and update the filters to check that the unique string is not equal to the current page's unique string. This way, the current record is excluded from the list of similar records.
Conclusion
I hope these little tricks help you in your application to find potential similar records. You can try this with various fields like email or date fields. It's a simple trick with data source filters to help you find similar records, and you can build ways to manage these records if needed.
Maybe in a future video, we'll explore how to merge similar records together—it might be fun to try. Thanks for watching this week's episode of Build It with Tim. I'll see you next week!
We'd love to hear your feedback.