# Get by filter

### 🎯 **What does this operation do?**

This operation allows searching records within a dictionary table using custom filters.

#### ✅ **Main features:**

* Retrieves multiple records based on specific criteria.
* Allows applying filters to refine the search.
* Can be used to load dynamic lists or validate information.

### 📂 **How to Configure the "Search by Filter" Operation**

#### 1️⃣ **Access the Component**

1. In **Hablla Studio**, open the automation flow where you want to search records in the dictionary.
2. Add the block **"Dictionary"**.
3. In the right side panel, select the operation **"Search by Filter"**.

#### 2️⃣ **Fill in the Required Fields**

| **Field**        | **Data Type** | **Required?** | **Description**                                            |
| ---------------- | ------------- | ------------- | ---------------------------------------------------------- |
| **Workspace ID** | `string`      | ✅ Yes         | Workspace ID where the dictionary table is located.        |
| **Table Name**   | `string`      | ✅ Yes         | Name of the dictionary table where the records are stored. |

#### 3️⃣ **Add Filters (Optional)**

In addition to the required fields, you can set filters to refine the search.

| **Filter**        | **Data Type**                  | **Description**                                                                   |
| ----------------- | ------------------------------ | --------------------------------------------------------------------------------- |
| **Custom Fields** | `collection`                   | Allows selecting which dictionary fields should be used as filters.               |
| **Filter Method** | `string` (`fields` or `query`) | Defines whether the search will be based on specific fields or on a query string. |
| **Sorting**       | `string` (`asc` or `desc`)     | Defines ascending order (`asc`) or descending order (`desc`) of the results.      |
| **Page**          | `number`                       | Allows defining the search page for result pagination.                            |
| **Limit**         | `number`                       | Defines how many records should be returned at a time.                            |

⚠️ **Attention!**

* If no filter is applied, the search will return all records from the table.
* Use pagination to avoid excessive return of records.

#### 4️⃣ **Save the Configuration**

After filling in the fields and setting the filters, click the **"Save"** ✅.

Now, whenever this automation is triggered, the filtered records will be returned automatically.

### 📌 **Usage Example in an Automation Flow**

📊 **Scenario:** You want to fetch all customers registered in the table **"Customers"** of the dictionary who are in the status **"Active"**.

#### 🔹 **Automation flow:**

1️⃣ **Block 1** → Trigger an automation whenever a customer performs an action.\
2️⃣ **Block 2** → Search the dictionary for all customers with status **"Active"**.\
3️⃣ **Block 3** → Send a personalized message to those customers.

🚀 **Result:** The automation filters and returns only the relevant records, allowing targeted and segmented communications.

### 🎉 **Conclusion**

The operation **Search Records by Filter in the Dictionary** is ideal for finding specific information in a dynamic and personalized way. With this feature, you can optimize searches and make your automations even smarter in Hablla Studio.

If you need more support, contact our team! 🚀
