Articles in this section
Category / Section

CSV Creator by FlowMattic

3 mins read
Updated:

Export & Generate CSV Files Automatically. CSV Creator is a powerful FlowMattic integration that enables you to automatically generate and export CSV files from multiple data sources in WordPress. Create CSV files from FlowMattic Tables, JSON data, or arrays, with advanced filtering using custom WHERE queries and dynamic date range shortcuts. Perfect for automated data exports, reporting workflows, customer list management, and seamless integration with external systems. All generated CSV files are automatically saved to your WordPress media library with customizable delimiters, headers, and file naming options. Key Features: Database table exports, custom SQL queries, date range filtering (7_DAYS_AGO, 1_MONTH_AGO), JSON to CSV conversion, array data transformation, automatic WordPress media library integration, flexible record limiting and sorting, multiple delimiter support (comma, semicolon, tab, pipe, colon), and dynamic file naming. Use Cases: Automated customer data exports, scheduled sales reports, product catalog generation, email marketing list creation, backup automation, third-party system integration, inventory snapshots, and data pipeline workflows.

Quick Start

The CSV Creator module provides three powerful actions to generate CSV files:

1. Create from FlowMattic Table

Export data from your FlowMattic tables with flexible filtering and sorting options.

Key Features:

  • Select any database (local or external) and table
  • Choose record selection mode:
    • All Records - Export everything
    • First X Records - Get the first N records
    • Last X Records - Get the most recent N records
    • Custom Query - Filter with WHERE conditions

Custom Query Power:

status = 'active'
country = 'USA'
created_at >= '2025-01-01'
price > 100 AND category = 'electronics'

Date Range Shortcuts:

created_at >= 7_DAYS_AGO        # Last 7 days
created_at <= 30_DAYS_AGO       # Older than 30 days
created_at >= 1_MONTH_AGO       # Last month
created_at >= 2_YEARS_AGO       # Last 2 years

Sort & Limit:

  • Sort results by ID (Ascending/Descending)
  • Limit number of records returned (optional)

2. Create from JSON

Convert JSON data into CSV format with automatic header detection.

Example:

[
  {"name": "John", "email": "[email protected]", "status": "active"},
  {"name": "Jane", "email": "[email protected]", "status": "pending"}
]

3. Create from Array

Use array data from previous workflow steps to create CSV files.

Perfect for:

  • Processing data from API responses
  • Converting filtered results from previous steps
  • Dynamic data transformation workflows

CSV Options

Delimiters:

  • Comma (,) - Default
  • Semicolon (;)
  • Tab
  • Pipe (|)
  • Colon (:)

Headers:

  • Include Headers - Column names as first row (recommended)
  • No Headers - Data only

File Naming:

  • Custom filename (optional) - e.g., customer-export
  • Auto-generated - FlowMattic-csv-YYYY-MM-DD-HH-MM-SS.csv

Response Data

Every CSV creation returns:

{
  "status": "success",
  "file_url": "https://example.com/wp-content/uploads/2025/10/export.csv",
  "file_path": "/var/www/html/wp-content/uploads/2025/10/export.csv",
  "file_size": "15.2 KB",
  "file_size_bytes": 15625,
  "record_count": 250,
  "attachment_id": 1234,
  "message": "CSV file created successfully"
}

Use these values in subsequent workflow steps!

Common Use Cases

📊 Data Exports

  • Export customer lists for email marketing
  • Generate product catalogs for external systems
  • Create backup files of important data

📈 Reporting

  • Daily sales reports
  • Monthly active user lists
  • Inventory snapshots

🔄 Data Integration

  • Export data for import into other systems
  • Generate feeds for third-party services
  • Create data pipelines between applications

🎯 Filtered Exports

  • Export only active customers: status = 'active'
  • Get US customers from last 30 days: country = 'USA' AND created_at >= 30_DAYS_AGO
  • High-value orders: total > 1000 AND status = 'completed'

Tips & Tricks

1. Combine with Schedulers
Set up automatic daily/weekly exports using FlowMattic’s Schedule trigger.

2. Email CSV Files
Chain with Email action to automatically send generated CSV files to recipients.

3. Use Dynamic File Names
Include dates or workflow data in filenames: sales-report-{current_date}

4. Test Your Queries
Start with a small limit (e.g., 10 records) to verify your WHERE conditions work correctly.

5. Handle Nested Data
JSON and Array sources automatically encode nested objects/arrays into CSV cells.


Available Since: FlowMattic 5.4.0

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Access denied
Access denied