Перейти к основному содержимому

Добавить строки в Excel Рабочий лист в n8n

Добавить строки является PDF4me действие узла в n8n тот, кто пишет JSON записи в Excel Рабочий лист. Используйте его для толкания. API результаты в отчет, записи содержимого веб-перехватчиков в общую рабочую книгу или добавление CRM экспортируется в таблицу отслеживания, при этом числа и даты отображаются в реальном времени. Excel Значения, а не текст.

Что делает этот узел?

PDF4me ExcelДобавить строки берет существующий .xlsx рабочая тетрадь плюс JSON массив в JSON Данные строки записывает по одной строке для каждого объекта. У него есть два режима размещения: назвать таблицу в Цель Excel Стол Ключи сопоставляются с заголовками, или же поле можно оставить пустым. Вставить из строки плюс Вставить из столбца Укажите точную начальную ячейку. Программа редактирует предоставленную вами рабочую книгу, а не создает ее с нуля.

Похожие записи в блоге
Пока нет публикации в блоге, посвященной этой функции — она скоро появится.
А пока что, загляните в блог PDF4me, где вы найдете обучающие материалы и рабочие процессы для всех платформ.
Посетите блог →

Аутентификация вашего API Запрос​

Каждый PDF4me узел в n8n требуется действительный Учетные данные для подключения кСоздайте или выберите тот, который содержит ваши данные. PDF4me API ключевой элемент, позволяющий рабочему процессу безопасно аутентифицировать запросы к электронным таблицам.

Важные факты, которые нельзя пропустить​

Цель Excel Таблица определяет режим
Заполнение этого поля переключает сопоставление узлов на сопоставление заголовков. Оставление поля пустым переключает на размещение координат. Все остальное, что касается размещения строк, определяется этим одним полем.
Он JSON должен быть плоским
Каждый объект становится строкой, а каждый ключ — столбцом. Вложенный объект или массив не имеет отдельной ячейки для размещения, поэтому преобразуйте полезную нагрузку в однородный массив до того, как она достигнет этого узла.
Режим координат может быть перезаписан.
Параметры «Вставить из строки» и «Вставить из столбца» по умолчанию равны 1, что соответствует верхней левой ячейке. Направляйте их на пустую область, если только вы не собираетесь заменить уже имеющуюся ячейку.
В узле n8n используется узел PDF4me Excel с параметром «Операция» — «Добавить строки», методом ввода данных из файла Excel — «Из предыдущего узла», массивом JSON в поле «Данные строки JSON», параметрами «Вставить из строки» и «Вставить из столбца» равными 1, а параметр «Преобразовать числовые значения и значения дат» включен.

JSON Данные строки содержат JSON Массив плоских объектов. Цель Excel В этой таблице нет данных, поэтому команды «Вставить из строки» и «Вставить из столбца» помещают данные в ячейку A1.

Табличный режим против координатного режима​

ВопросРежим таблицыРежим координат
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

Какие параметры необходимы для добавления строк?​

ПараметрНеобходимыйЧто это делаетПример
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

Выход​

ПолеТипЧто в нём содержится
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.

Обновленная рабочая книга возвращается в виде двоичных данных, готовых к записи в хранилище, прикреплению к электронному письму или передаче в дальнейшее приложение. Excel шаг.

Как настроить добавление строк в n8n?​

  1. Добавить PDF4me Excel добавьте узел к вашему рабочему процессу и установите Операция к Добавить строки.
  2. Выберите свой PDF4me учетные данные или создайте их и вставьте свои. API ключ.
  3. Выберите Excel Метод ввода файла и укажите название рабочей книги в поле, которое появится под ней.
  4. Набор Название рабочего листа точно на ту вкладку листа, куда вы записываете данные.
  5. Вставьте JSON массив плоских объектов в JSON Данные строкпо одному объекту в каждой строке.
  6. Для использования табличного режима введите название таблицы в поле Цель Excel Стол и установить Excel Ряд NumberЧтобы использовать координаты, оставьте таблицу пустой и задайте значение. Вставить из строки и Вставить из столбца.
  7. Оставлять Преобразование числовых значений и дат включено, затем установить Шаблон формата даты, Шаблон числового формата, и Культурные и языковые условия для сопоставления с вашими данными.
  8. Набор Имя выходного файлазапустите узел и проверьте rowsAdded в ответе перед дальнейшей переадресацией рабочей книги.

Типичные конфигурации​

Примеры рабочих процессовCommon n8n workflow patterns using Add Rows.
Записывайте данные веб-перехватчиков в рабочую книгу.
  1. Веб-хук получает отправленную форму в качестве JSON.
  2. Функция «Добавить строки» добавляет их в именованную таблицу в общей рабочей книге.
  3. Команда читает таблицу, не требуя повторного ввода данных.
Толкать API результаты в отчет
  1. запланированный HTTP Запрос извлекает записи из внутреннего источника. API.
  2. Узел Code преобразует ответ в простой массив.
  3. Функция «Добавить строки» записывает данные в шаблон отчета в фиксированных координатах.
Добавить ночной CRM экспорт
  1. Ночная работа открывает новые возможности, поскольку JSON.
  2. В табличном режиме ключи сопоставляются с существующими заголовками.
  3. Изменение порядка столбцов в исходных данных не приводит к нарушению работы листа.
Перед распространением проверьте правильность записи.
  1. Функция «Добавить строки» возвращает значение rowsAdded рядом с рабочей книгой.
  2. Узел IF сравнивает это значение с длиной входного массива.
  3. При возникновении несоответствия вместо отправки краткого отчета выдается предупреждение.

Практические советы​

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.

Шпаргалка​

ПолеЦенить
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

Часто задаваемые вопросы​

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.

Связанные действия​

Аналогичная задача на других платформах.​

Получить помощь​