Saltar al contenido principal

Agregar filas a un Excel Hoja de trabajo en n8n

Agregar filas es un PDF4me acción del nodo en n8n que escribe JSON registros en un Excel hoja de trabajo. Úsala para empujar API resultados en un informe, registrar cargas útiles de webhook en un libro de trabajo compartido o agregar CRM exportaciones a una hoja de seguimiento, con números y fechas que llegan como reales Excel valores en lugar de texto.

Lo que hace este nodo

PDF4me Excel: Agregar filas toma uno existente .xlsx un libro de ejercicios más un JSON matriz en JSON Datos de filay escribe una fila por objeto. Tiene dos modos de colocación: nombre una tabla en Objetivo Excel Mesa y las claves se hacen coincidir con los encabezados, o déjelo en blanco y Insertar desde fila más Insertar desde columna Establece la celda de inicio exacta. Edita un libro de trabajo que proporciones en lugar de crear uno desde cero.

Entradas de blog relacionadas
Aún no hay ninguna entrada de blog sobre esta función; estará disponible próximamente.
Mientras tanto, echa un vistazo al blog de PDF4me para encontrar tutoriales y flujos de trabajo para todas las plataformas.
Visita el blog

Autenticando su API Pedido

Cada PDF4me nodo en n8n requiere un válido Credencial para conectarse con. Crea o selecciona uno que contenga tu PDF4me API clave para que el flujo de trabajo pueda autenticar de forma segura las solicitudes de hojas de cálculo.

Datos importantes que no debes perderte

Objetivo Excel La mesa decide el modo
Al rellenarlo, el nodo cambia a coincidencia de encabezado. Si se deja en blanco, cambia a colocación de coordenadas. Todo lo demás sobre cómo se colocan las filas se deriva de ese único campo.
El JSON debe ser plano
Cada objeto se convierte en una fila y cada clave en una columna. Un objeto o matriz anidada no tiene una sola celda que ocupar, por lo que se aplana la carga útil antes de que llegue a este nodo.
El modo de coordenadas puede sobrescribir
Las opciones Insertar desde fila e Insertar desde columna se establecen por defecto en la celda 1, que es la celda superior izquierda. Apuntalas a una región vacía, a menos que quieras reemplazar el contenido existente.
El nodo PDF4me Excel en n8n con Operación establecida en Agregar filas, Método de entrada de archivo Excel establecido en Desde nodo anterior, una matriz JSON en Datos de fila JSON, Insertar desde fila e Insertar desde columna establecidos en 1, y Convertir valores numéricos y de fecha activado

JSON Los datos de fila contienen un JSON Conjunto de objetos planos. Objetivo Excel La tabla está vacía aquí, por lo que las funciones Insertar desde fila e Insertar desde columna colocan los datos en la celda A1.

Modo tabla frente a modo coordenadas

PreguntaModo mesaModo de coordenadas
How you switch to itName a table in Target Excel TableLeave Target Excel Table blank
How columns are matchedJSON keys matched against table headersValues written in key order from the start cell
Does column order matterNo, headers drive placementYes, position drives placement
Which fields control itTarget Excel Table and Excel Row NumberInsert From Row and Insert From Column
Best forStructured sheets that already have a tableBlank sheets or a fixed reporting layout
Overwrite riskLower, rows follow the table structureHigher, the start cell is written to directly

¿Qué parámetros necesita la función Agregar filas?

ParámetroRequeridoLo que haceEjemplo
Credential to connect withRequiredThe PDF4me API credential the node authenticates with.PDF4me API
OperationRequiredThe action this node performs. Select Add Rows.Add Rows
Excel File Input MethodRequiredHow the workbook reaches the node: from the previous node as binary data, as a Base64 string, or from a URL.From Previous Node (Binary Data)
Binary Data Property NameConditionalName of the binary property holding the .xlsx. Appears when the workbook comes from the previous node.data
Worksheet NameRequiredSheet the rows are written to. Match the sheet tab name exactly.Sheet1
JSON Row DataRequiredJSON array of flat objects. Each object becomes one row and each key maps to a column.[{"Date":"2024-01-15","Amount":1500.00}]
Insert From RowConditionalRow number the data starts at, counting from 1. Used in coordinate mode when no table is named.1
Insert From ColumnConditionalColumn number the data starts at, counting from 1 for column A. Used in coordinate mode.1
Target Excel TableOptionalName of an existing table to write into. Filling this in switches the node to header matching instead of coordinates.Table1
Excel Row NumberConditionalRow index inside the named table where insertion begins. Used in table mode.1
Convert Numeric and Date ValuesOptionalToggle that turns numeric and date strings into real Excel values rather than text. Ships enabled.enabled
Date Format PatternOptionalPattern applied to converted dates. Match it to the shape of the dates in your JSON.yyyy-MM-dd
Numeric Format PatternOptionalFormat applied to converted numbers, such as two decimal places.N2
Skip JSON Property NamesOptionalToggle that omits the JSON keys, writing only values. Ships disabled so headers are included.disabled
Skip Null ValuesOptionalToggle that leaves cells untouched where a JSON value is null instead of clearing them. Ships disabled.disabled
Culture and Language SettingsOptionalCulture code used when parsing numbers and dates, which decides separator handling.en-US
Output File NameOptionalFilename of the returned workbook. Keep a valid Excel extension.excel_with_rows.xlsx

Producción

CampoTipoLo que contiene
fileNameStringName of the returned workbook after the rows were written.
fileSizeNumberSize of the returned workbook in bytes.
successBooleanWhether the insertion completed. Branch on this so failures surface as alerts.
originalFileNameStringName of the input workbook as supplied to the node.
worksheetNameStringThe worksheet the rows were written to.
rowsAddedNumberHow many rows were inserted. The most useful verification signal the node returns.
insertFromRowNumberStarting row used, echoed back when running in coordinate mode.
insertFromColumnNumberStarting column used, echoed back when running in coordinate mode.
tableNameStringThe table written into, or null when coordinate mode was used.
excelRowNumberNumberRow index inside the table where insertion began, in table mode.
convertNumericAndDateBooleanWhether numeric and date conversion was applied.
dateFormatStringThe date pattern applied during conversion.
numericFormatStringThe numeric format applied during conversion.
cultureNameStringThe culture code used to parse numbers and dates.
messageStringHuman-readable summary, including the row count and worksheet name.

El libro de trabajo actualizado se devuelve como datos binarios, listos para escribir en el almacenamiento, adjuntar a un correo electrónico o pasar a otro proceso. Excel paso.

¿Cómo configuro Agregar filas en? n8n¿

  1. Añade el PDF4me Excel nodo a su flujo de trabajo y configurar Operación a Agregar filas.
  2. Seleccione su PDF4me credencial, o cree una y pegue su API llave.
  3. Elige un Excel Método de entrada de archivos y proporcione el libro de trabajo a través del campo que aparece debajo.
  4. Colocar Nombre de la hoja de trabajo a la pestaña exacta de la hoja en la que está escribiendo.
  5. Pon un JSON conjunto de objetos planos en JSON Datos de fila, un objeto por fila.
  6. Para usar el modo tabla, ingrese el nombre de la tabla en Objetivo Excel Mesa y establecer Excel Fila NumberPara usar coordenadas, deje la tabla en blanco y configure Insertar desde fila y Insertar desde columna.
  7. Dejar Convertir valores numéricos y de fecha habilitado, luego configurar Patrón de formato de fecha, Patrón de formato numérico, y Contextos culturales y lingüísticos para que coincida con sus datos.
  8. Colocar Nombre del archivo de salida, ejecute el nodo y verifique rowsAdded en la respuesta antes de enrutar el libro de trabajo.

Configuraciones típicas

Ejemplos de flujo de trabajoCommon n8n workflow patterns using Add Rows.
Registrar las cargas útiles de los webhooks en un libro de trabajo.
  1. Un webhook recibe un envío de formulario como JSON.
  2. La función Agregar filas la añade a una tabla con nombre en un libro de trabajo compartido.
  3. El equipo lee la hoja de cálculo sin que nadie vuelva a introducir los datos.
Empujar API resultados en un informe
  1. Un programado HTTP La solicitud extrae registros de un archivo interno. API.
  2. Un nodo de código transforma la respuesta en una matriz simple.
  3. La función Agregar filas lo escribe en la plantilla de informes en coordenadas fijas.
Agregar una noche CRM exportar
  1. Un trabajo nocturno ofrece nuevas oportunidades JSON.
  2. El modo tabla hace coincidir las claves con los encabezados existentes.
  3. Los cambios en el orden de las columnas en el código fuente no dañan la hoja de cálculo.
Verifica la escritura antes de distribuirla.
  1. Agregar filas devuelve las filas agregadas junto con el libro de trabajo.
  2. Un nodo IF lo compara con la longitud del array de entrada.
  3. En caso de discrepancia, se activa una alerta en lugar de enviar un informe breve.

Consejos prácticos

Flatten the JSON first
A Set or Code node that removes nesting is cheaper than debugging why a column arrived empty or full of object text.
Prefer table mode when a table exists
Header matching survives column reordering in the source system, which fixed coordinates cannot.
Check rowsAdded, not just success
A run can succeed while inserting fewer rows than you sent. Comparing the count to your array length catches silent shortfalls.
Match culture to the data, not the reader
Culture drives how decimal and thousands separators are parsed. Set it to the format the JSON arrives in.
Point coordinates at empty cells
Insert From Row and Insert From Column both default to 1, so an unchanged run writes over the top-left of the sheet.
Keep a template workbook
This action edits an existing file. Storing a clean template that the workflow copies each run avoids gradual drift.

Hoja de trucos

CampoValor
OperationAdd Rows
Excel File Input MethodFrom Previous Node (Binary Data)
Binary Data Property Namedata
Worksheet NameSheet1
JSON Row Data[{"Date":"2024-01-15","Amount":1500.00}]
Insert From Row / Column1 / 1
Target Excel TableTable1
Excel Row Number1
Convert Numeric and Date Valuesenabled
Date Format Patternyyyy-MM-dd
Numeric Format PatternN2
Culture and Language Settingsen-US
Output File Nameexcel_with_rows.xlsx

Preguntas frecuentes

What JSON format does Add Rows expect?+
A JSON array of flat objects, where each object is one row and each key is a column. Nested objects and arrays have no natural cell to land in, so flatten the structure first, for example with an n8n Code node. The array shape itself follows the ordinary JSON data model.
What is the difference between table mode and coordinate mode?+
Naming a table in Target Excel Table puts the node in table mode, where JSON keys are matched against the table headers so column order in your data does not matter. Leaving it blank uses coordinate mode, where Insert From Row and Insert From Column decide the exact starting cell and values are written in key order.
Why did my numbers and dates arrive as text?+
That happens when Convert Numeric and Date Values is turned off, or when the culture does not match the incoming data. The toggle ships enabled, and Date Format Pattern, Numeric Format Pattern, and Culture and Language Settings control how the strings are parsed and formatted on the way in.
Does Add Rows overwrite existing data?+
In coordinate mode the node writes starting at the row and column you name, so pointing it at occupied cells replaces what is there. Target an empty region, or use table mode so rows follow the table structure rather than a fixed address.
Can I add rows to several sheets in one run?+
Not in a single execution, because Worksheet Name takes one sheet. Chain a second Add Rows node fed by the first node output, or loop the workbook through the node once per sheet, so each pass writes to its own worksheet.

Acciones relacionadas

La misma tarea en otras plataformas

Obtén ayuda