Skip to main content

Parse CSV to JSON in Power Automate with PDF4me

PDF4me CSV - Parse to JSON is a Power Automate action that converts a CSV file into a structured JSON array with a three-tier header priority system and configurable delimiter. Use it to feed CSV exports into databases, REST APIs, or Excel without writing a custom parser in your flow.

What this action does

PDF4me CSV - Parse to JSON reads a CSV file and returns a Base64-encoded JSON array of objects, with Column Headers, Skip First Line, and Culture Name controlling how rows and headers are interpreted. Any delimiter works, and malformed rows are handled gracefully instead of failing the flow.

Related Blog Posts
No blog post yet for this feature — coming soon.
In the meantime, browse the PDF4me blog for tutorials and workflows across every platform.
Visit the blog

How Do I Authenticate My Power Automate Flow?

Every PDF4me action in Power Automate requires a valid connection. Create or select one that holds your PDF4me API key so the flow can authenticate CSV parsing requests securely.

Important Facts You Should Not Miss

Header handling has a strict 3-tier priority
Column Headers wins if provided (every CSV line becomes data). Otherwise Skip First Line set to true uses the first CSV line as headers. If both are empty, headers auto-generate as Column1, Column2, and so on.
Culture Name is an easy-to-miss advanced parameter
Hidden under Advanced parameters alongside Column Headers and Skip First Line, Culture Name sets the locale used to interpret region-specific number and date formats in the CSV.
Parsing is permissive, not strict
Rows with fewer values than headers get empty strings, rows with more values have the extras ignored, and malformed data returns an empty array instead of throwing an error.
Power Automate PDF4me CSV - Parse to JSON action configured with File Content, File Name, CSV Delimiter, and Advanced parameters Column Headers, Skip First Line, and Culture Name

Map File Content and File Name, set CSV Delimiter, then expand Advanced parameters for Column Headers, Skip First Line, and Culture Name.

Parameters

Required: File Content, File Name, and CSV Delimiter must be provided. Column Headers, Skip First Line, and Culture Name are optional advanced parameters.

ParameterRequiredWhat it doesExample
File ContentRequiredBase64 content of the source CSV file, mapped from SharePoint, OneDrive, or an email attachment.[File Content from Get File]
File NameRequiredCSV filename including extension, used for processing and output identification.data.csv
CSV DelimiterRequiredCharacter or short string separating columns. Comma, semicolon, tab, and pipe are all supported, as are multi-character delimiters.,
Column HeadersOptionalComma-separated custom header names. When provided, every CSV line including the first is treated as data and Skip First Line is ignored.FullName,Age,Email
Skip First LineOptionalWhen true and Column Headers is empty, uses the first CSV line as headers and starts data from the second line. Default false.true
Culture NameOptionalLocale used to interpret region-specific number and date formats in the CSV content.en-US

Output Fields

FieldTypeWhat it contains
documentBase64The parsed JSON array, UTF-8 encoded and Base64 wrapped.
FileNameStringFixed output filename, "parsed_data.json".
SuccessBooleantrue if parsing completed, false if the action failed.
ErrorMessageStringError description, null when Success is true.
ErrorsArrayDetailed error objects with Code and Message, empty when Success is true.

What Do the Common Error Messages Mean?

Error MessageCauseSolution
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.

How Do I Set Up Parse CSV in Power Automate?

  1. Add PDF4meCSV - Parse to JSON to your Power Automate flow.
  2. Map File Content and File Name from a previous action (SharePoint, OneDrive, or email attachment).
  3. Set CSV Delimiter to match your source file (comma, semicolon, tab, or pipe).
  4. Expand Advanced parameters and set Column Headers for custom names, or Skip First Line to use the file's own header row.
  5. Run the flow, decode the document Base64 output, and loop through the resulting JSON array with Apply to each.

Typical Setups

Workflow ExamplesCommon Power Automate flow patterns using Parse CSV.
CSV-to-database import
  1. A CSV file lands in a SharePoint "Imports" folder, triggering the flow.
  2. Parse CSV converts it to JSON with CSV Delimiter set to a comma and Skip First Line enabled.
  3. The document output is decoded and parsed into individual JSON objects.
  4. Apply to each loops through the records and inserts them via a SQL connector.
  5. The processed CSV is moved to an "Archive" folder.
European export to REST API
  1. A source system emails a semicolon-delimited CSV export.
  2. Parse CSV runs with CSV Delimiter set to a semicolon and Skip First Line enabled.
  3. Each parsed record is posted to a REST API endpoint with HTTP.
  4. Response codes are collected to flag any failed records.
  5. A summary is emailed once the loop completes.
CSV to Excel with custom headers
  1. A legacy report arrives as a tab-delimited CSV with no header row.
  2. Parse CSV runs with CSV Delimiter set to a tab and Column Headers set explicitly.
  3. The resulting JSON array feeds a PDF4me Add Rows action to populate an Excel template.
  4. The formatted Excel workbook is emailed to stakeholders.

Practical Tips

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.

Cheat Sheet

FieldValue
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

Common Questions

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/pdf4meconnect/" target="_blank" rel="noopener noreferrer">the PDF4me Power Automate connector reference</a> for background.

Industry Use Cases & Applications

  • Legacy System Integration: Parse CSV exports from legacy systems to JSON
  • API Data Feed: Convert CSV data to JSON for REST API consumption
  • Database Migration: Parse CSV files for database import operations
  • Log File Processing: Parse CSV-formatted log files for analysis

Same Task on Other Platforms

Get Help