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

解析 CSV に JSON で Power Automate と PDF4me

PDF4me CSV - JSONへのパース は Power Automate 変換するアクション CSV ファイルを構造化 JSON 3段階のヘッダー優先度システムと設定可能な区切り文字を備えた配列。これを使用してフィードします。 CSV データベースへのエクスポート、 REST APIフロー内でカスタムパーサーを作成せずに、s または Excel を使用できます。

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

PDF4me CSV - JSONへのパース 読む CSV ファイルと返します Base64-エンコード JSON 列ヘッダー、最初の行のスキップ、カルチャ名によって行とヘッダーの解釈方法を制御するオブジェクトの配列です。任意の区切り文字が使用可能で、形式が正しくない行も処理フローを中断することなく適切に処理されます。

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

認証方法 Power Automate 流れ?​

毎 PDF4me アクション Power Automate 有効な接続が必要です。 PDF4me API フローが認証できるようにするためのキー CSV リクエストを安全に解析する。

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

ヘッダー処理には厳格な3段階の優先順位があります
列ヘッダーが指定されている場合は優先されます(すべての列ヘッダーが指定されている場合)。 CSV 行がデータになります)。そうでない場合は、Skip First Line が true に設定されていると、最初の行が使用されます。 CSV 行をヘッダーとして指定します。両方とも空の場合は、Column1、Column2、…のようにヘッダーが自動的に生成されます。
カルチャー名は、見落としやすい高度なパラメーターです。
詳細パラメーターの下に隠されている「列ヘッダー」と「最初の行をスキップ」では、地域固有の数値と日付の形式を解釈するために使用されるロケールを設定します。 CSV。
構文解析は厳密ではなく、寛容である。
ヘッダーよりも値が少ない行には空の文字列が返され、値が多い行では余分な文字列は無視され、不正なデータの場合はエラーを発生させる代わりに空の配列が返されます。
Power Automate PDF4me CSV - JSONへの解析アクションは、ファイルコンテンツ、ファイル名、CSV区切り文字、および詳細パラメーター(列ヘッダー、最初の行をスキップ、カルチャ名)を使用して構成されています。

マップファイルの内容とファイル名を設定し、 CSV 区切り文字を選択し、次に「列ヘッダー」、「最初の行をスキップ」、「カルチャ名」の詳細パラメーターを展開します。

パラメータ​

必須: ファイルの内容、ファイル名、 CSV 区切り文字は必須です。列ヘッダー、最初の行をスキップ、カルチャ名はオプションの高度なパラメータです。

パラメータ必須その機能例
File ContentOptionalContent of the CSV file to parse. 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 CSV file, including its extension (for example `data.csv`). Map it from the file name returned by a previous action. Defaults to `ParseCsv.csv`.data.csv
CSV DelimiterOptionalCharacter used to separate values in the CSV. Defaults to `,`.,
Column HeadersOptionalColumn headers to use instead of those in the file, as a comma-separated list.your value
Skip First LineOptionalSkip the first line when parsing.No
Culture NameOptionalCulture name for data parsing.your value

出力フィールド​

分野タイプ内容物
Parsed ContentFile contentThe parsed CSV data. The connector describes it as JSON or Excel file content and declares it as file content (format byte).
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 or CSV content is null.Provide valid CSV file content.
Encoding exceptionsCSV content is not UTF-8 encoded.Re-save or export the CSV file as UTF-8.
Empty array outputCSV content is empty or contains only a header row.Provide a CSV file with at least one data row.

Parseの設定方法を教えてください CSV で Power Automate?​

  1. 追加 PDF4me → CSV - JSONへのパース あなたの Power Automate 流れ。
  2. 地図 ファイルの内容 そして ファイル名 以前のアクションから(SharePoint、 OneDrive(またはメール添付ファイル)。
  3. セット CSV区切り文字 ソースファイルに合わせて(カンマ、セミコロン、タブ、またはパイプ)。
  4. 拡大する 詳細パラメータ そして設定する 列ヘッダー カスタム名の場合、または 最初の行をスキップ ファイル自身のヘッダー行を使用する。
  5. フローを実行し、デコードします 書類 Base64 出力し、結果として得られたものをループ処理します。 JSON 配列 それぞれに適用する。

典型的な構成​

ワークフローの例Common Power Automate flow patterns using Parse CSV.
CSVからデータベースへのインポート
  1. A CSV ファイルは SharePoint 「Imports」フォルダがフローをトリガーします。
  2. CSV を解析して、 JSON と CSV 区切り文字をカンマに設定し、「最初の行をスキップ」を有効にしました。
  3. ドキュメント出力はデコードされ、個々の JSON オブジェクト。
  4. Apply to each ループはレコードを順に処理し、SQL コネクタを介してレコードを挿入します。
  5. 処理された CSV 「アーカイブ」フォルダに移動されます。
欧州からのREST APIへのエクスポート
  1. ソースシステムはセミコロン区切りの電子メールを送信します CSV 輸出。
  2. CSV解析は以下で実行されます CSV 区切り文字をセミコロンに設定し、「最初の行をスキップ」を有効にしました。
  3. 解析された各レコードは、 REST API エンドポイント HTTP。
  4. 応答コードは、失敗したレコードを特定するために収集されます。
  5. ループが完了すると、概要がメールで送信されます。
カスタムヘッダー付きCSVからExcelへの変換
  1. レガシーレポートはタブ区切り形式で届きます CSV ヘッダー行なし。
  2. CSV解析は以下で実行されます CSV 区切り文字はタブに設定され、列ヘッダーは明示的に設定されています。
  3. 結果として JSON 配列は PDF4me Excelテンプレートにデータを入力するには、「行の追加」アクションを使用します。
  4. 書式設定済みのExcelワークブックは、関係者にメールで送信されます。

実践的なヒント​

Column Headers overrides Skip First Line completely
If you set Column Headers, Skip First Line is ignored and every CSV row, including what looks like a header row, is treated as data. Do not set both expecting them to combine.
Match the delimiter exactly to the export locale
European CSV exports commonly use a semicolon instead of a comma, especially when the source system uses comma as the decimal separator. Check a sample row before hardcoding the delimiter.
Decode document before parsing further
The document output is Base64-encoded JSON text, not a ready-to-use object. Decode it first, then use Parse JSON to expose individual fields for Apply to each.
Set Culture Name for non-US number formats
If the CSV uses comma as a decimal separator or day-first dates, set Culture Name to match (for example de-DE or en-GB) so downstream conversions do not misread values.
Treat empty output as a signal, not a crash
An empty array back from Parse CSV usually means the file only had a header row or was empty, not that the flow failed. Check Success and Errors before assuming the source file is fine.

チートシート​

分野価値
ActionCSV - Parse to JSON
Header priorityColumn Headers > Skip First Line > auto-generated
Common delimiters, (comma) / ; (semicolon) / \t (tab) / | (pipe)
Output filenameparsed_data.json (fixed)
Output formatdocument (Base64 JSON array)
Malformed data behaviorReturns empty array, does not error

よくある質問​

How do I parse a CSV file to JSON in Power Automate?+
Add the PDF4me CSV - Parse to JSON action, map File Content and File Name from a prior action, set the CSV Delimiter, then choose Column Headers or Skip First Line for header handling. The action returns document, a Base64 JSON array you can decode and loop through.
What is the header priority order?+
Column Headers takes priority if provided, every CSV line including the first is treated as data. If Column Headers is empty and Skip First Line is true, the first CSV line becomes the headers. If both are empty, headers are auto-generated as Column1, Column2, and so on.
What happens with malformed or empty CSV data?+
CSV parsing is permissive. Rows with fewer values than headers are filled with empty strings, rows with more values than headers have the extras ignored, and empty or header-only CSV content returns an empty JSON array rather than an error.
What does the Culture Name parameter do?+
Culture Name is an advanced parameter that sets the locale used when interpreting the CSV content, useful when the source file uses region-specific number or date conventions that differ from the default parsing culture.
Can I parse semicolon or tab-delimited CSV files?+
Yes. CSV Delimiter accepts any character or short string, including semicolon for European exports, tab for TSV files, or pipe for database exports. Multi-character delimiters are also supported. See <a href="https://www.rfc-editor.org/rfc/rfc4180" target="_blank" rel="noopener noreferrer">RFC 4180, the common CSV format specification</a> and <a href="https://learn.microsoft.com/en-us/connectors/pdf4me/" target="_blank" rel="noopener noreferrer">the PDF4me Power Automate connector reference</a> for background.

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

  • レガシーシステム統合レガシーシステムからのCSVエクスポートをJSONに解析する
  • APIデータフィードCSVデータをREST APIで使用できるJSON形式に変換する。
  • データベース移行データベースインポート操作のためにCSVファイルを解析する
  • ログファイル処理: 分析のためにCSV形式のログファイルを解析する

関連アクション​

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

ヘルプが必要な場合​