# Looplist

## Actions: Uso del nodo “Loop list” en Dapta

***

### 🧩 ¿Qué es el nodo LoopList?

El nodo LoopList permite recorrer una lista de elementos uno por uno dentro de un flujo en Flow Studio. Cada elemento puede representar un contacto, fila de datos u otro tipo de objeto, sobre el cual se puede ejecutar una acción personalizada (como enviar un mensaje, hacer una llamada o procesar datos).

{% embed url="<https://www.loom.com/share/6b895da1a9124cf88ba275d0858e5853?sid=75239c63-5e9b-4a49-a89f-805c24ed71db>" %}

***

### 🔧 Pasos para configurarlo correctamente

#### 1. Crear el flujo

Primero, se crea un nuevo flujo en Flow Studio.

***

#### 2. Añadir el nodo LoopList

Desde el panel derecho, en la sección Actions, se arrastra el nodo LoopList al lienzo del flujo.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfpy-Ybfxbx3WYpnyzDvhZ7iAEBz2KTtzcKYIp_qtcr3toPEqOS-mhD6eGY9nkB6y5DKYyd17pgfncsE85IvmHiWoHeGqaE2GFK-y91WzVeBByEQGYnYsCVvn7_M12I-2ssz2p1?key=9YSyKeQB5b8hE3FIWSEoMg" alt=""><figcaption></figcaption></figure>

***

#### 3. Obtener la lista a recorrer

Se utiliza un nodo de Google Sheets previamente configurado:

* Se selecciona la credencial.
* Se elige la operación: Obtener filas (Get Rows).
* Se especifica el documento y la hoja de cálculo (ej. "Contacts").

***

#### 4. Conectar los nodos

* Se conecta el Trigger al nodo de Google Sheets.
* Luego, se conecta Google Sheets ➝ LoopList.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcrmR_g7r3Uczf98pajC9nqiA8gO1hKYN0oXXORzICv5ZnlNvkDsFjtEO5_ZGYL1nfcS9X6LsTHc5Gjfodt8sT6Btx4l9v3TYZg4cNDhlbPu9IH6CL_YYMxIOUwNBtwmJkDWldr?key=9YSyKeQB5b8hE3FIWSEoMg" alt=""><figcaption></figcaption></figure>

***

#### 5. Definir el input del LoopList

En el campo input del nodo LoopList se debe pasar el array proveniente del nodo de Google Sheets:

response.values

Esto asegura que se pase correctamente la lista de contactos al LoopList para ser recorrida uno a uno.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcNb-HKLhzEsSgqmjNHfFBU4HIWpOIaJScdMIU8w73AP3Gwfy5mJ7QYizN6PbrsTxSE6D4eqIPsvQhr4gZmcNpHxn6S70tbS-F5KLqiVItwWaKS6mL26_cSAQGuJd02BQq-Qil-ag?key=9YSyKeQB5b8hE3FIWSEoMg" alt=""><figcaption></figcaption></figure>

***

### 🛠️ Recorrer los elementos de la lista

#### 6. Crear un nodo de código (ej. format)

* Este nodo se utiliza para procesar cada elemento de la lista de forma individual.
* Para acceder al dato actual del ciclo, se usa la siguiente sintaxis:

params.looplist.item

* Desde ahí puedes extraer los valores específicos:

params.looplist.item.telefono

params.looplist.item.nombre

params.looplist.item.empresa

params.looplist.item.email

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf4xDzOVICH2rt0OG6Tw1jZV8T310Sk16A-AgonkzxTUFvblngGVKCExVLvsO56TodN7_1hpuwf19egyqKcfKqIo8hh4QLYjvHDI5zOkm9LIYzBTXhWkMybMZqB_lGzJgbdu7s3?key=9YSyKeQB5b8hE3FIWSEoMg" alt=""><figcaption></figcaption></figure>

***

#### 7. Exportar variables para usarlas más adelante

Una vez extraídas, exporta las variables deseadas con este bloque:

module.exports = {

telefono: params.looplist.item.telefono,

nombre: params.looplist.item.nombre,

empresa: params.looplist.item.empresa,

email: params.looplist.item.email

}

***

8\. Añadir un nodo “Response”

Cuando el nodo “Loop list” termina de recorrer los contactos añadimos un nodo de “Response” en la opción “Done” la cual nos indicará cuando el ciclo termina cuando se corra el flujo.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXerNfq50Ey1K0cozhfzxuJLm_HoHx2C6FSUka6Kzara6YiEFvBV9CvnFQyAu-qDn4eiji4sxF1zKUPhHVExh7bCl-ySRluDuN5XOrODzk2D7gdcBMiDDA4SqFtcmQlisuvgoSSJpQ?key=9YSyKeQB5b8hE3FIWSEoMg" alt=""><figcaption></figcaption></figure>

### ✅ Resultado

Al correr el flujo:

* Cada elemento de la lista se procesa individualmente.
* El nodo format permite visualizar que los datos se están extrayendo correctamente.
* Puedes continuar con acciones como enviar mensajes personalizados, hacer llamadas o registrar información.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXepoKOTSPQ_4Qt_3FLMM36oX9TDH-OhD5pQn4yI8kkQT4vxq2Pi7mzbAtXsREJAi38ca_fbFwBRwj94UGYOrOpiyxGj90qSG605QyXFYc4SmEYa2BUNOp_YEPo0Sb1q3ylW0y3BXQ?key=9YSyKeQB5b8hE3FIWSEoMg" alt=""><figcaption></figcaption></figure>

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcF62jWdhqjpaSgSIUAO5yTBrQjf8Ccy5NJb4ywSK60f-Bb8V27os3jv0yZOcIj-wXGDZ4kAYIiFPaS6vyVcPsKLAeOsUSnWvmlAl-y03Ysu7f2T8ytlzFp27EzomCele7bQGGGXw?key=9YSyKeQB5b8hE3FIWSEoMg" alt=""><figcaption></figcaption></figure>

\ <br>

<br>


---

# 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.dapta.ai/dapta-docs-es/actions/looplist.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.
