Skip to main content

Parse CSV in Power Automate

PDF4me Parse CSV action converts CSV (Comma-Separated Values) files to structured JSON data in Power Automate with flexible delimiter and header options. This powerful data transformation feature supports custom delimiters (comma, semicolon, tab, pipe, or custom characters), custom header names, automatic header detection from first line, or auto-generated column headers, with UTF-8 encoding support and automatic empty line removal, perfect for CSV data integration, database imports, API feeding, and automated data format conversion workflows across Microsoft 365.

Authenticating Your API Request

To access the PDF4me Web API through Power Automate, every request must include proper authentication credentials. Authentication ensures secure communication and validates your identity as an authorized user, enabling seamless integration between your Power Automate flows and PDF4me's powerful CSV parsing services.

Parse CSV Power Automate

Key Features

  • Flexible Delimiter Support: Parse comma, semicolon, tab, pipe, or custom delimiters
  • Custom Headers: Define custom column headers or use from file
  • Automatic Header Detection: Use first line as headers with SkipFirstLine option
  • Auto-Generated Headers: Automatic Column1, Column2... generation when needed
  • JSON Output: Structured JSON array of objects for easy integration
  • UTF-8 Encoding: Full Unicode support for international characters

Parameters

Complete list of parameters for the Parse CSV action. Configure these parameters to control CSV parsing.

Important: Parameters marked with an asterisk (***) are required. The action outputs JSON data with filename parsed_data.json.

ParameterTypeDescriptionExample
File Content***Base64Source CSV File Content
• Map CSV file from previous action output
• Supports CSV files from SharePoint, OneDrive, email attachments
• Can be dynamically retrieved from flow variables
• Must be valid CSV document (UTF-8 encoded text)
[File Content from Get File]
File Name***StringCSV Document Name
• Specify CSV file name with extension (.csv, .txt)
• Used for processing and output file naming
• Must include proper file extension
• Supports dynamic naming from flow variables
data.csv
Delimiter***StringColumn Delimiter Character(s)
• Character(s) separating columns
Common delimiters: , (comma - standard CSV), ; (semicolon - European CSV), \t (tab - TSV files), | (pipe - database exports), (space)
• Supports multi-character delimiters (e.g., ", " for comma-space)
• Required - must be specified
,
Column HeadersStringComma-Separated Custom Headers
• Define custom header names
• Format: "Name,Age,Email"
Header Priority 1 (Highest): If provided → Uses custom headers, SkipFirstLine ignored, ALL CSV lines treated as data (including first line)
If empty: Use Priority 2 (file headers) or Priority 3 (auto-generated)
Parsing Behavior: Headers/values trimmed of whitespace; Fewer values than headers → fills with empty strings; More values than headers → extra values ignored
FullName,Age,Email
Skip First LineBooleanUse First Line as Headers
Header Priority 2: If true AND ColumnHeaders empty → Uses first CSV line as headers, data starts from second line
Header Priority 3: If false AND ColumnHeaders empty → Auto-generates headers ("Column1", "Column2"...), all lines are data
• Default: false
• Ignored when ColumnHeaders provided
true

Output

The PDF4me Parse CSV action returns comprehensive JSON output data for seamless Power Automate flow integration:

Table View

Response data in a structured table format:

ParameterTypeDescription
documentBase64JSON data as UTF-8 byte array
FileNameStringOutput filename: "parsed_data.json" (fixed)
SuccessBooleantrue if operation successful, false if failed
Error MessageStringError description (null if successful)
ErrorsArrayList of detailed error information (empty array if successful)

Common Error Messages

Understanding and troubleshooting errors helps ensure smooth CSV parsing workflows:

Error MessageCauseSolution
"Request is empty"Request object is nullProvide valid request object
"Document is empty"Document object is null or CSV content is nullProvide valid CSV file content
Encoding exceptionsCSV content not UTF-8 encodedEnsure CSV file is UTF-8 encoded
Empty array outputCSV content is empty or only has headersProvide CSV file with data rows

Note: CSV parsing is permissive - malformed data returns empty array instead of errors.

Workflow Examples

The PDF4me Parse CSV action in Power Automate provides comprehensive workflow templates designed for real-world business scenarios:

Automated CSV to Database Import Workflow

Transform your data import with automated CSV parsing and database loading:

Complete Workflow Steps:

  1. Trigger: CSV file uploaded to SharePoint "Imports" folder
  2. Get CSV File: Retrieve uploaded CSV file from SharePoint
  3. Parse CSV: Set Delimiter = ",", SkipFirstLine = true
  4. Get JSON Data: Extract parsed JSON from document field
  5. Parse JSON Array: Convert to individual objects
  6. Loop Through Records: Use Apply to each for JSON array
  7. Insert to SQL: Execute SQL INSERT for each record
  8. Log Results: Record successful/failed imports
  9. Move File: Move processed CSV to "Processed" folder
  10. Send Summary: Email admin with import statistics

Business Benefits:

  • Imports 500+ CSV rows to database daily automatically
  • Converts CSV format to JSON for database compatibility
  • Eliminates manual CSV import and data entry
  • Reduces import time from 2 hours to 5 minutes

Industry Use Cases & Applications

IT & System Integration Use Cases

  • 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

Get Help