# Create or Update

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

This operation checks if the organization already exists in the system:

* If **does not exist**, **creates a new record** with the provided data.
* If **already exists**, **updates the data** of the organization.

This prevents duplicate records and keeps the data always up to date.

✅ Organization name\
✅ CNPJ\
✅ Address, phones and emails\
✅ Organization owner\
✅ Custom tags\
✅ Company status in the sales funnel

***

### 📂 **How to Configure the "Create or Update" Operation**

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

1. In **Hablla Studio**, open the automation flow where you want to create or update an organization.
2. Add the **Organizations block**.
3. In **right side panel**, select the operation **"Create or Update"**.

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

* **Organization Name** (Required field) → Set the company name.
* **CNPJ** (Optional) → If available, enter the CNPJ for unique identification.
* **Identification Rule** → Defines how the system will consider the organization as existing:
  * **Oldest** (keeps the first record found)
  * **Most recent** (updates the most recent organization)

#### 3️⃣ **Add Additional Information** *(Optional)*

* **About** → Description of the organization.
* **Address** → Add ZIP code, street, number, city and state.
* **Phones** → Enter personal or business numbers.
* **Emails** → Add contact emails.
* **Organization Owner** → Select a responsible user.
* **Tags** → Associate keywords for segmentation.
* **Customer Status** → Choose between:
  * Prospect
  * Engaged
  * In Negotiation
  * Active Customer
  * Inactive Customer
  * Advocate
  * Lost
  * Not Qualified

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

After filling in the necessary fields, click the button **"Save"** ✅.

Now, whenever this automation is triggered, **the organization will be created or updated automatically**.

***

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

📊 **Scenario:** You want to create a flow where, when capturing a new lead, it is automatically linked to an existing organization or a new organization is created if it is not yet registered.

1. **Block 1** → Capture a **new lead** via form.
2. **Block 2** → Check if the **organization already exists** in the system.
3. **Block 3** → If the organization **exists**, update the data.
4. **Block 4** → If the organization **does not exist**, create it automatically.

Result: 🚀 **The company will always be registered or updated as needed!**

***

### 🎉 **Conclusion**

The operation **Create or Update Organization** in Hablla Studio prevents duplicate records and keeps the data always consistent, ensuring a more efficient and organized CRM.

If you need more support, contact our team! 🚀


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hablla.com/hablla-docs-en/automation-flows/all-components/hablla/organizations/create-or-update.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
