Passa al contenuto principale

Aggiungi righe a un Excel Foglio di lavoro in n8n

Aggiungi righe è un PDF4me azione del nodo in n8n che scrive JSON registra in un Excel foglio di lavoro. Usalo per spingere API i risultati in un report, registra i payload del webhook in una cartella di lavoro condivisa o aggiungi CRM esportazioni su un foglio di tracciamento, con numeri e date che arrivano come reali Excel valori piuttosto che testo.

Cosa fa questo nodo

PDF4me Excel: Aggiungi righe prende un esistente .xlsx quaderno di lavoro più un JSON matrice in JSON Dati rigae scrive una riga per oggetto. Ha due modalità di posizionamento: nomina una tabella in Bersaglio Excel Tavolo e le chiavi vengono abbinate alle intestazioni, oppure lascialo vuoto e Inserisci dalla riga altro Inserisci dalla colonna Imposta la cella di partenza esatta. Modifica una cartella di lavoro fornita dall'utente anziché crearne una da zero.

Articoli correlati del blog
Non ci sono ancora post sul blog dedicati a questa funzionalità — in arrivo a breve.
Nel frattempo, dai un'occhiata al blog di PDF4me per trovare tutorial e procedure operative su tutte le piattaforme.
Visita il blog

Autenticazione del tuo API Richiesta

Ogni PDF4me nodo in n8n richiede un valido Credenziali per connettersi con. Crea o selezionane uno che contenga il tuo PDF4me API chiave affinché il flusso di lavoro possa autenticare in modo sicuro le richieste di fogli di calcolo.

Informazioni importanti da non perdere

Bersaglio Excel La tabella decide la modalità
Compilandolo, il nodo passa alla corrispondenza dell'intestazione. Lasciandolo vuoto, si passa al posizionamento delle coordinate. Tutto il resto relativo al posizionamento delle righe dipende da questo singolo campo.
IL JSON deve essere piatto
Ogni oggetto diventa una riga e ogni chiave diventa una colonna. Un oggetto o un array annidato non ha una singola cella da occupare, quindi appiattisci il payload prima che raggiunga questo nodo.
La modalità coordinate può sovrascrivere
Le opzioni "Inserisci da riga" e "Inserisci da colonna" sono impostate di default su 1, ovvero la cella in alto a sinistra. Selezionatele per selezionare un'area vuota, a meno che non intendiate sostituire il contenuto già presente.
Il nodo PDF4me Excel in n8n con Operazione impostata su Aggiungi righe, Metodo di input file Excel impostato su Dal nodo precedente, un array JSON in Dati riga JSON, Inserisci da riga e Inserisci da colonna impostati su 1 e Converti valori numerici e data attivato.

JSON I dati della riga contengono un JSON matrice di oggetti piatti. Obiettivo Excel La tabella è vuota in questo punto, quindi Inserisci da riga e Inserisci da colonna posizionano i dati nella cella A1.

Modalità tabella vs. modalità coordinate

DomandaModalità tavoloModalità coordinate
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

Quali parametri sono necessari per aggiungere righe?

ParametroNecessarioCosa faEsempio
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

Produzione

CampoTipoCosa 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.

La cartella di lavoro aggiornata viene restituita come dati binari, pronti per essere scritti nella memoria, allegati a un'e-mail o passati a un altro Excel fare un passo.

Come si imposta l'aggiunta di righe in n8n?

  1. Aggiungi il PDF4me Excel nodo al tuo flusso di lavoro e impostalo Operazione A Aggiungi righe.
  2. Seleziona il tuo PDF4me credenziali oppure creane una e incolla il tuo API chiave.
  3. Scegli un Excel Metodo di immissione file e inserire la cartella di lavoro attraverso il campo che appare sottostante.
  4. Impostato Nome del foglio di lavoro alla scheda del foglio specifica su cui stai scrivendo.
  5. Metti un JSON matrice di oggetti piatti in JSON Dati riga, un oggetto per riga.
  6. Per utilizzare la modalità tabella, immettere il nome della tabella in Bersaglio Excel Tavolo e impostare Excel Riga Number. Per utilizzare le coordinate, lasciare la tabella vuota e impostare Inserisci dalla riga E Inserisci dalla colonna.
  7. Partire Convertire valori numerici e date abilitato, quindi impostato Modello formato data, Modello di formato numerico, E Contesto culturale e linguistico per abbinare i tuoi dati.
  8. Impostato Nome del file di output, esegui il nodo e controlla rowsAdded nella risposta prima di inoltrare la cartella di lavoro.

Configurazioni tipiche

Esempi di flusso di lavoroCommon n8n workflow patterns using Add Rows.
Registra i payload dei webhook in una cartella di lavoro
  1. Un webhook riceve l'invio di un modulo come JSON.
  2. La funzione Aggiungi righe aggiunge i dati a una tabella denominata in una cartella di lavoro condivisa.
  3. Il team legge il foglio senza che nessuno debba reinserire i dati.
Spingere API risultati in un rapporto
  1. Un programma HTTP la richiesta estrae i record da un interno API.
  2. Un nodo Code appiattisce la risposta in un array semplice.
  3. La funzione Aggiungi righe scrive i dati nel modello di report in posizioni fisse.
Aggiungi un aggiornamento notturno CRM parco
  1. Un lavoro notturno porta nuove opportunità come JSON.
  2. La modalità tabella associa le chiavi alle intestazioni esistenti.
  3. Le modifiche all'ordine delle colonne nel codice sorgente non compromettono il foglio di calcolo.
Verificare la scrittura prima della distribuzione
  1. Il metodo Add Rows restituisce rowsAdded insieme alla cartella di lavoro.
  2. Un nodo IF lo confronta con la lunghezza dell'array di input.
  3. Una discrepanza genera un avviso anziché inviare un breve report.

Consigli pratici

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.

Foglio riassuntivo

CampoValore
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

Domande frequenti

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.

Azioni correlate

Stessa attività su altre piattaforme

Richiedi assistenza