# Update

The operation **Update Task** allows modifying an existing task in the system, ensuring that all relevant information is updated as needed.

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

This operation updates an existing task within a workspace, enabling modification of information such as:

* ✅ Task name
* ✅ Detailed description
* ✅ Task type (call, meeting, email, chat, other)
* ✅ Responsible user
* ✅ Start and end date
* ✅ Association with people, cards, organizations and services
* ✅ Task checklist

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

1️⃣ **Access the Component**

In Hablla Studio, open the automation flow where you want to update a task.

2️⃣ **Add the "Tasks" Block**

In the right side panel, select the operation **Update**.

3️⃣ **Choose How to Specify the Body**

You can specify the task data **Using Fields** or **Using JSON**.

### 🔹 **Specify Body: Using Fields**

If the option **Using Fields** is selected, the following fields can be filled in:

| Field                    | Type            | Required | Description                                                                                                                                   |
| ------------------------ | --------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Task Name**            | `string`        | ✅ Yes    | Name or title of the task being updated.                                                                                                      |
| **About**                | `string`        | ❌ No     | Additional information about the task.                                                                                                        |
| **Description**          | `string`        | ✅ Yes    | Detailed description of the task.                                                                                                             |
| **Task Type**            | `string (enum)` | ✅ Yes    | Specifies the task type: call, meeting, email, chat or other.                                                                                 |
| **Start Date**           | `datetime`      | ❌ No     | Start date and time of the task.                                                                                                              |
| **Finish Date**          | `datetime`      | ❌ No     | Expected date and time for task completion.                                                                                                   |
| **Responsible User**     | `string`        | ❌ No     | ID of the user responsible for carrying out the task.                                                                                         |
| **Associated Person ID** | `string`        | ❌ No     | ID of the person related to the task.                                                                                                         |
| **Organization ID**      | `string`        | ❌ No     | ID of the organization related to the task.                                                                                                   |
| **Associated Card ID**   | `string`        | ❌ No     | ID of the card to which the task is linked.                                                                                                   |
| **Sector**               | `string`        | ❌ No     | Sector or department related to the task.                                                                                                     |
| **Checklist**            | `array`         | ❌ No     | List of items to be checked or completed within the task. Each item in the array must follow the structure: `{ "item": "Item description" }`. |

✅ After filling in the fields, click **Save** to complete the configuration.

### 🔹 **Specify Body: Using JSON**

If the option **Using JSON** is selected, use the following format to send the task data:

```json
{
  "name": "Meeting with client",
  "description": "Discuss commercial proposal and align next steps.",
  "about": "This task is part of the sales pipeline.",
  "type": "meet",
  "color": "blue",
  "user": "idUser",
  "start_date": "2025-03-04T10:00:00Z",
  "finish_date": "2025-03-04T11:00:00Z",
  "person": "idPerson",
  "card": "idCard",
  "service": "idService",
  "organization": "idOrganization",
  "sector": "idSector",
  "checklist": [
    {
      "name": "Prepare presentation",
      "done": false,
      "order": 1
    },
    {
      "name": "Confirm client's availability",
      "done": true,
      "order": 2
    }
  ]
}
```

🔍 **ID Format**

The fields `person`, `card`, `service`, `organization`, `sector` and `user` must contain IDs in the following format:

```
674f6ee3debc8828cde11e3b
```

To make reading easier, the placeholders were used in the example above `idPerson`, `idCard`, `idService`, `idOrganization`, `idSector` and `idUser`.

✅ After inserting the JSON correctly, click **Save** to complete the configuration.

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

🎯 **Scenario:** Automatically update a task after a stage in the sales process is completed.

1️⃣ **Block 1** → Capture the completion of a stage in the sales pipeline.

2️⃣ **Block 2** → Update the corresponding task in the CRM with the new information.

3️⃣ **Block 3** → Notify the responsible user about the task update.

🚀 **Result:** Whenever a stage of the sales process is completed, the corresponding task will be automatically updated in the system, ensuring that all information is synchronized.

### 🎉 **Conclusion**

The operation **Update Task** in Hablla Studio allows you to keep activities organized and up to date within the system. You can choose between configuring the fields manually or using a custom JSON for greater flexibility.

If you need more support, contact our team! 🚀
