Pular para o conteúdo principal

Adicionar linhas a um Excel Folha de exercícios em n8n

Adicionar linhas é um PDF4me ação do nó em n8n que escreve JSON registros em um Excel planilha. Use-a para pressionar API os resultados em um relatório, registre os payloads do webhook em uma pasta de trabalho compartilhada ou anexe-os. CRM Exporta para uma planilha de controle, com números e datas registrados como dados reais. Excel valores em vez de texto.

O que este nó faz

PDF4me ExcelAdicionar linhas pega um existente .xlsx caderno de exercícios mais um JSON matriz em JSON Dados da linhae escreve uma linha por objeto. Possui dois modos de posicionamento: nomeie uma tabela em Alvo Excel Mesa e as chaves são correspondidas aos cabeçalhos, ou deixe em branco e Inserir da linha mais Inserir da coluna Defina a célula inicial exata. Ela edita uma planilha que você fornece, em vez de criar uma do zero.

Artigos relacionados no blogue
Ainda não há nenhuma publicação no blogue sobre esta funcionalidade — em breve.
Entretanto, explore o blogue da PDF4me para encontrar tutoriais e fluxos de trabalho para todas as plataformas.
Visite o blogue

Autenticando seu API Solicitar

Todo PDF4me nó em n8n requer um válido Credencial para se conectar comCrie ou selecione um que contenha o seu PDF4me API chave para que o fluxo de trabalho possa autenticar solicitações de planilhas com segurança.

Fatos importantes que você não deve perder

Alvo Excel A tabela define o modo
Preencher esse campo altera o nó para correspondência de cabeçalho. Deixá-lo em branco altera o posicionamento para coordenadas. Todo o resto sobre como as linhas são posicionadas depende desse único campo.
O JSON deve ser plano
Cada objeto se torna uma linha e cada chave se torna uma coluna. Um objeto ou array aninhado não possui uma única célula para ocupar, portanto, achate a carga útil antes que ela chegue a este nó.
O modo de coordenadas pode sobrescrever
As opções Inserir da Linha e Inserir da Coluna têm como padrão a célula 1, que é a célula superior esquerda. Aponte-as para uma região vazia, a menos que você pretenda substituir o conteúdo existente.
O nó PDF4me Excel no n8n com a Operação definida como Adicionar Linhas, o Método de Entrada do Arquivo Excel definido como Do Nó Anterior, uma matriz JSON em Dados da Linha JSON, Inserir da Linha e Inserir da Coluna definidos como 1 e Converter Valores Numéricos e de Data ativado.

JSON Os dados da linha contêm um JSON Conjunto de objetos planos. Alvo Excel A tabela está vazia aqui, então Inserir da Linha e Inserir da Coluna colocam os dados na célula A1.

Modo de tabela vs. Modo de coordenadas

PerguntaModo de tabelaModo 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

Quais parâmetros são necessários para adicionar linhas?

ParâmetroObrigatórioO que fazExemplo
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

Saída

CampoTipoO que contém
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.

A planilha atualizada é retornada como dados binários, pronta para ser gravada em um dispositivo de armazenamento, anexada a um e-mail ou utilizada em outra aplicação. Excel etapa.

Como faço para configurar a adição de linhas em n8n?

  1. Adicione o PDF4me Excel Adicione um nó ao seu fluxo de trabalho e configure-o. Operação para Adicionar linhas.
  2. Selecione o seu PDF4me credencial, ou crie uma e cole a sua API chave.
  3. Escolha um Excel Método de entrada de arquivo e forneça a planilha através do campo que aparece abaixo dela.
  4. Definir Nome da folha de exercícios para a aba exata da planilha em que você está escrevendo.
  5. Coloque um JSON matriz de objetos planos em JSON Dados da linha, um objeto por linha.
  6. Para usar o modo de tabela, insira o nome da tabela em Alvo Excel Mesa e definir Excel Linha NumberPara usar coordenadas, deixe a tabela em branco e defina Inserir da linha e Inserir da coluna.
  7. Deixar Converter valores numéricos e de data ativado, em seguida, configure Padrão de formato de data, Padrão de formato numérico, e Contextos culturais e linguísticos para corresponder aos seus dados.
  8. Definir Nome do arquivo de saída, execute o nó e verifique rowsAdded na resposta, antes de encaminhar a planilha adiante.

Configurações típicas

Exemplos de fluxo de trabalhoCommon n8n workflow patterns using Add Rows.
Registre os dados do webhook em uma planilha.
  1. Um webhook recebe um envio de formulário como JSON.
  2. A opção Adicionar Linhas anexa os dados a uma tabela nomeada em uma pasta de trabalho compartilhada.
  3. A equipe lê a planilha sem que ninguém precise digitar os dados novamente.
Empurrar API resulta em um relatório
  1. Um agendado HTTP A solicitação extrai registros de um banco de dados interno. API.
  2. Um nó de código transforma a resposta em uma matriz simples.
  3. A opção Adicionar Linhas insere os dados no modelo de relatório em coordenadas fixas.
Adicione um noturno CRM exportação
  1. Um emprego noturno oferece novas oportunidades, pois JSON.
  2. O modo de tabela relaciona as chaves aos cabeçalhos existentes.
  3. Alterações na ordem das colunas na fonte não quebram a planilha.
Verifique a gravação antes de distribuir.
  1. A função Adicionar Linhas retorna as linhas adicionadas juntamente com a planilha.
  2. Um nó IF compara o valor com o comprimento da matriz de entrada.
  3. Uma incompatibilidade gera um alerta em vez de enviar um relatório resumido.

Dicas práticas

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.

Folha de dicas

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

Perguntas frequentes

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.

Ações relacionadas

Mesma tarefa em outras plataformas

Obtenha ajuda