> For the complete documentation index, see [llms.txt](https://helpcenter.channable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://helpcenter.channable.com/manage-improve-product-data/manage-product-and-improve-data-es/reglas-edicion-masiva-y-enriquecimiento/how-to-use-actions-then-in-rules/acciones-matematicas/rule-action-calculate-sum.md).

# Calcular la suma de valores

Calcula el total de los valores numéricos guardados en un campo de lista.

Utiliza **`calcola somma`** para sumar todos los valores numéricos de un campo de lista.

Esta acción es útil para tareas como:

* Calcular el stock total de todas las tallas de producto.
* Calcular un total a partir de varios valores numéricos.

***

## Ejemplo `calcola somma` casos de uso

### Calcular el stock total de todas las tallas

Utiliza esta regla cuando cada artículo tenga un valor en el `stock` campo. Primero, utiliza [Crea grupos de artículos](https://helpcenter.channable.com/manage-improve-product-data/manage-product-and-improve-data-es/reglas-edicion-masiva-y-enriquecimiento/how-to-use-actions-then-in-rules/acciones-de-articulos/rule-action-build-item-group.md) A recopilar el `stock` valores de los Artículos con el mismo `Articolo_group_ID` En un nuevo `stock_list` campo. Allora, utiliza **`calcula somma`** para sumar los valores en `stock_list` y guarda el total en `total_stock`.

#### Cómo crear una Regola

* Condición: **`Para todo Articoli`**
* Acción: allora **`creare un gruppo di articoli`** basado en `Articolo_group_ID` di campo `stock` e memoriza en `stock_list`
* Acción: allora **`calcula somma`** di `stock_list` e memorizza in `total_stock`

{% hint style="info" icon="lightbulb" %}

#### Consejo

Añadir **`crear un grupo de artículos`** antes **`calcola somma`**. El `stock_list` el Campo debe existir antes de que puedas calcular su total.
{% endhint %}

### Añadir cantidades de almacén

Utiliza esta regla cuando un campo de tipo lista contenga cantidades de stock de varios almacenes.

#### Cómo crear una Regola

* Condición: **`Para todo Articoli`**
* Acción: ALLORA **`calcula somma`** di `warehouse_stock_list` e guarda el resultado en `available_stock`


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://helpcenter.channable.com/manage-improve-product-data/manage-product-and-improve-data-es/reglas-edicion-masiva-y-enriquecimiento/how-to-use-actions-then-in-rules/acciones-matematicas/rule-action-calculate-sum.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
