> 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-it/regole-modifica-in-blocco-e-arricchisci/how-to-use-actions-then-in-rules/azioni-per-calcolare/rule-action-calculate-list-length.md).

# calcular la longitud de un campo Lista

Conta tutti i valori o solo quelli univoci en un campo Lista.

Usa **`calcular la longitud de la lista`** per contar els valors d'un camp de llista.

Questa azione è utile per attività come:

* Comptar les talles de producte o els URL d'imatge disponibles.
* Comptar els valors diferents sense tenir en compte els duplicats.

***

## Exemple `calcular la longitud de la lista` casos d'ús

{% hint style="info" %}

#### Suggerimento

Selecciona l'opció de valors únics si els valors duplicats no han d'incrementar el recompte.
{% endhint %}

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

#### Suggerimento

Afegeix **`creare gruppo di ítems`** prima **`calcular la longitud de la lista`**. Il campo della lista deve esistere prima di poterne contare i valori.
{% endhint %}

### Contare le taglie disponibili

Usa questa regola quando ogni ítem ha un valore nel `size` campo. Per prima cosa, usa [Crea gruppi di ítem](https://helpcenter.channable.com/manage-improve-product-data/manage-product-and-improve-data-it/regole-modifica-in-blocco-e-arricchisci/how-to-use-actions-then-in-rules/azioni-per-gli-items/rule-action-build-item-group.md) per raccogliere gli `size` valori degli ítem con lo stesso `ítem_group_ID` en un nuovo `size_list` campo. Causa, usa **`calcular la longitud de la lista`** Para contare i valori en `size_list` y salva il conteggio en `size_count`.

#### Come creare una Regla

* Condizione: **`Per tutti gli articoli`**
* Azione: causa **`Crea gruppo di ítem`** in base a `ítem_group_ID` de campo `size` e almacenare en `size_list`
* Azione: causa **`calcular la longitud de la lista`** de `size_list` y almacenar en `size_count`

### Conta gli URL univoci delle immagini

usar questa Regla quando ogni ítem ha un valore en `image_url` campo. Primero, usare **`Crear grupo de ítems`** Per raccogliere il `image_url` valori degli Ítems con lo stesso `ítem_group_ID` en un nuovo `image_url_list` campo. causa, conta i valori univoci en `image_url_list` y salva il conteggio en `image_count`.

#### Come creare una Regla

* Condizione: **`Per tutti gli articoli`**
* Azione: causa **`crear grupo de ítems`** in base a `ítem_group_ID` de campo `image_url` y almacenar en `image_url_list`
* Azione: causa **`calcular la longitud de la lista`** de valori univoci en `image_url_list` e almacenare en `image_count`


---

# 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-it/regole-modifica-in-blocco-e-arricchisci/how-to-use-actions-then-in-rules/azioni-per-calcolare/rule-action-calculate-list-length.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.
