メインコンテンツへスキップ

行を結合する Excel で Power Automate

PDF4me 行を結合する は Power Automate グループが複製するアクション Excel 1つ以上のキー列に基づいて行を分割し、残りの値を1つの統合行に結合します。この機能を使用すると、重複する顧客、カテゴリ、またはトランザクションのエントリをキーごとに1行にまとめたり、キー列を空白のままにして完全に重複する行を削除したりできます。

このアクションが何をするか

PDF4me 行を結合する 読む Excel ファイルとキー列番号のセットを指定すると、同じキー値を持つ行がグループ化され、各グループ内の重複値を削除した後、各グループの非キー値がセミコロン区切りで結合されます。キー列が指定されていない場合、すべての列値を共有する行は完全に重複しているものとして扱われます。

関連ブログ記事
この機能に関するブログ記事はまだありません。近日公開予定です。
その間、PDF4me ブログを閲覧して、あらゆるプラットフォームのチュートリアルやワークフローをご覧ください。
ブログをご覧ください →

認証 API リクエスト​

アクセスするには PDF4me ウェブ API を通して Power Automateすべてのリクエストには有効な API キー。認証はあなたの身元を検証し、コネクタがアクセスできるようにします。 PDF4meの Excel フローからの行マージサービス。

見逃してはならない重要な事実​

マージキー列は、グループ化する内容を決定します。
キーとして指定された列は重複行を識別し、最初に出現した値を保持します。その他の列はすべて値列として扱われ、結合されます。
値はセミコロンで区切られて結合されます
一致する行から空でない値が収集され、そのセット内の重複する値が削除され、残ったものが「;」で結合されます。
空のマージキー列は、完全に重複しているもののみを削除します。
キー列が指定されていない場合、すべての列がキーとして扱われるため、すべての列で同一の行のみが統合され、値の結合は行われません。
Power Automate PDF4me Excel 行結合アクションで、ファイルコンテンツ、ファイル名、ワークシート番号、結合キー列、出力フォーマットの各フィールドが表示されます。

前の操作からファイルの内容とファイル名をマッピングし、ワークシート番号と結合キー列を設定してから、出力形式を選択します。

パラメータ​

必須: ファイルの内容、ファイル名、およびワークシート番号は必ず指定する必要があります。結合キー列と出力形式は条件付きであり、それぞれ空白の場合の代替動作が定義されています。

パラメータ必須その機能例
File ContentOptionalContent of the Excel file to process. Map it from the file content returned by a previous action, such as SharePoint or OneDrive Get file content.@{body('Get_file_content')?['$content']}
File NameOptionalName of the Excel file, including its extension (for example `report.xlsx`). Map it from the file name returned by a previous action. Defaults to `MergeRows.xlsx`.report.xlsx
Worksheet NumbersOptionalWorksheets whose rows are merged, as a comma-separated list of positions counting from 1, for example `1,2`.1,2
Merge Key ColumnsOptionalColumns used to match rows between the worksheets, as a comma-separated list of column numbers counting from 1, for example `1` or `1,3`.1
Output FormatOptionalFormat for the merged output. Options: XLSX, XLSB, XLS, CSV. Defaults to `XLSX`.XLSX

行の結合はどのような結果を返しますか?​

分野タイプ内容物
Merged Rows ContentFile contentContent of the file with the merged rows, in the chosen Output Format. Map it into the next action, for example the File Content field of SharePoint or OneDrive Create file.
SuccessYes/NoWhether the operation completed successfully
Error MessageTextError message if operation failed
Error DetailsArrayList of detailed error messages

よくあるエラーメッセージ​

エラーメッセージ原因解決
Request is emptyRequest object is null.Provide a valid request object.
Document is emptyDocument object is null.Provide a valid Excel document.
Invalid worksheet selectionWorksheet number is out of range or in an invalid format.Use valid 1-based worksheet numbers within the workbook.
Available worksheets in workbook ({X} total)Informational detail returned alongside a worksheet validation failure.Use worksheet numbers from 1 to the reported total.
Worksheet {number} not foundWorksheet number exceeds the workbook's total worksheet count.Use a valid worksheet number from 1 to the total count.
Error processing file: {message}Generic processing error during the merge operation.Check file integrity, data structure, and parameter values.

行の結合を設定するにはどうすればいいですか Power Automate?​

  1. 追加 PDF4me → 行を結合する あなたの Power Automate 流れ。
  2. 地図 ファイルの内容 そして ファイル名 以前のアクションから、例えば SharePoint または OneDrive ファイルの内容を取得します。
  3. 入力 ワークシート番号 例えば、1から始まるワークシートインデックスのカンマ区切りリストとして。 1 または 1,3。
  4. 入力 キー列を結合する グループ化の基準となる1ベースの列番号として、例えば 6または、完全に重複する行のみを削除する場合は、空欄のままにしてください。
  5. セット 出力形式 XLSX、XLS、XLSB、または CSVまたは、XLSXのデフォルト設定のままにしてください。
  6. フローを実行します。重複する行はグループ化され、マージされ、統合されたファイルは次のように返されます。 document。

マージキー列を空白にしておくべきなのはどのような場合ですか?​

離れる キー列を結合する 完全に同一の行のみを削除することが目的の場合、例えば同じレコードが2回取り込まれたインポートをクリーンアップする場合などは、空白のままにします。このモードではすべての列がキーの一部として扱われるため、マージするキー以外の列は残らず、値統合ではなく、単純な完全重複削除として動作します。

典型的な構成​

ワークフローの例Common Power Automate flow patterns using Merge Rows.
顧客注文の統合
  1. 毎日の注文エクスポートが完了すると、繰り返しトリガーが実行されます。
  2. Get File Content は、その日の注文ワークブックを取得します。 SharePoint。
  3. 行の結合は、結合キー列がCustomerID列に設定され、ワークシート番号が「1」に設定された状態で実行されます。
  4. 顧客ごとに1行ずつ、注文詳細が統合されたファイルは、営業チームにメールで送信されます。
完全重複削除によるインポートのクリーンアップ
  1. 新しいファイルが「クリーンアップ」フォルダに移動すると、フローが開始されます。 SharePoint フォルダ。
  2. ファイルコンテンツを取得すると、アップロードされたファイルを取得します。 Excel 重複行が含まれる可能性のあるファイル。
  3. 「行の結合」機能は「結合キー列」を空欄のまま実行するため、すべての列で同一の行のみが結合されます。
  4. クリーニングされたファイルは「クリーニング済みデータ」フォルダに保存されます。
カテゴリレベルの在庫集計
  1. 週ごとの繰り返しトリガーによって在庫レポートが開始されます。
  2. 「ファイルコンテンツ取得」は、記録システムから詳細な在庫ワークブックを取得します。
  3. 行の結合は、結合キー列がカテゴリ列とサブカテゴリ列の番号に設定された状態で実行されます。
  4. 一致する行の製品IDと数量は、カテゴリごとに1つの行に統合され、週次サマリーライブラリにアーカイブされます。

実践的なヒント​

Pick key columns deliberately
Any column not listed in Merge Key Columns becomes a value column that gets merged. Double-check the column numbers against the worksheet before running the flow on production data.
Merged values lose their original row context
Once several rows are combined with a semicolon separator, you can no longer tell which merged value came from which original row unless a key column preserves that link.
Column numbers are 1-based, not 0-based
Column 1 is column A, column 2 is column B, and so on. Passing a 0-based index will target the wrong column.
Duplicate values within a merge group are removed once
If three duplicate rows share the same value in a non-key column, that value appears only once in the merged cell rather than being repeated three times.
Worksheet Numbers applies the same merge logic per sheet
When multiple worksheet numbers are listed, each worksheet is merged independently using the same Merge Key Columns setting.

チートシート​

分野価値
ActionMerge Rows
File ContentMapped from a prior file-retrieval action
File Namee.g. test.xlsx
Worksheet Numbers1-based, comma-separated: "1" or "1,3,5"
Merge Key Columns1-based column numbers to group on, e.g. "6"; blank = exact duplicates only
Value merge separator"; " between deduplicated non-key values
Output FormatXLSX (default), XLS, XLSB, or CSV
Outputdocument (Base64), FileName, Success, Error Message, Errors

よくある質問​

How do I merge duplicate rows in Excel using Power Automate?+
Add the PDF4me Merge Rows action, map File Content and File Name from a prior action, set Worksheet Numbers, and enter Merge Key Columns as the 1-based column numbers that identify a duplicate row. Non-key values from matching rows are combined into a single row with a semicolon separator.
What happens if Merge Key Columns is left empty?+
Leaving Merge Key Columns empty treats every column as part of the key, so only rows that are 100 percent identical across all columns are merged. This mode removes exact duplicate rows without combining any values, since there are no non-key columns left to merge.
How are values combined when rows are merged?+
For each non-key column, PDF4me collects the non-empty values from every matching row, removes duplicate values within that set, and joins what remains with a semicolon and space separator. See <a href="https://learn.microsoft.com/en-us/office/vba/api/excel.range.consolidate" target="_blank" rel="noopener noreferrer">Microsoft's Excel consolidation reference</a> for how native Excel handles a similar grouping concept.
Can I merge rows across multiple worksheets in one request?+
Yes. Worksheet Numbers accepts a comma-separated list of 1-based worksheet indexes, such as 1,3,5, and the merge runs independently on each specified worksheet within the same file.
Which output formats does Merge Rows support?+
Output Format accepts XLSX, XLS, XLSB, or CSV, matched case-insensitively. XLSX is the default and offers the widest compatibility. See <a href="https://learn.microsoft.com/en-us/connectors/pdf4me/" target="_blank" rel="noopener noreferrer">the PDF4me Power Automate connector reference</a> for the full action list.

業界におけるユースケースとアプリケーション​

販売およびEコマースのユースケース

  • 顧客注文の統合顧客ごとに複数の注文を1つの行にまとめる
  • 製品販売集計複数の取引にわたる製品別の売上を統合する
  • テリトリーロールアップ地域またはエリア別に販売データを統合する
  • 重複リードの削除マーケティングリストから完全に重複するリードを削除する

関連アクション​

他のプラットフォームでの同じタスク​

ヘルプが必要な場合​