A WordPress plugin that provides XLSX to CSV/JSON conversion functionality for FlowMattic workflows using the PHP Functions module.
This plugin registers a custom PHP function flowmattic_convert_xlsx that can be called directly from FlowMattic's PHP Functions action step to convert XLSX files to CSV or JSON format with streaming support.
- Convert XLSX files to CSV or JSON format
- Streaming support for large files
- Easy integration with FlowMattic workflows
- Powered by PHPSpreadsheet library
- Memory-efficient processing
- Upload the
flowmattic-xlsx-conversion-apifolder to your/wp-content/plugins/directory - Activate the plugin through the 'Plugins' menu in WordPress
- The function
flowmattic_convert_xlsxwill be automatically available for use in FlowMattic workflows
In your FlowMattic workflow, add a PHP Functions action step.
In the PHP Functions configuration screen:
flowmattic_convert_xlsx
Select: Individual Variable
This ensures each parameter is passed separately to the function.
Add two parameters:
-
Parameter 1:
- Key:
file_url - Value: Your XLSX file URL (can be a dynamic value from previous steps)
- Example:
https://domain.com/files/data.xlsx
- Key:
-
Parameter 2:
- Key:
conversion_type - Value:
csvorjson - Options:
csv- Convert to CSV formatjson- Convert to JSON format
- Key:
Select: Pass as it is
Function Name: flowmattic_convert_xlsx
Function Parameters:
- file_url: https://domain.com/files/data.xlsx
- conversion_type: csv
Click the Test button to verify the conversion works correctly.
The function returns a JSON response with the following structure:
{
"status": "success",
"data": "...converted data...",
"format": "csv"
}or for JSON format:
{
"status": "success",
"data": [...array of rows...],
"format": "json"
}{
"status": "error",
"message": "Error description"
}After the PHP Functions step, you can access the response data in subsequent workflow steps:
- Full Response:
{{step_id.response}} - Status:
{{step_id.response.status}} - Data:
{{step_id.response.data}} - Format:
{{step_id.response.format}}
Replace step_id with the actual ID of your PHP Functions step.
The CSV output includes:
- Header row with column names
- Data rows with values
- Proper escaping of special characters
- UTF-8 encoding with BOM for Excel compatibility
The JSON output is structured as an array of objects:
[
{
"Column1": "Value1",
"Column2": "Value2",
"Column3": "Value3"
},
{
"Column1": "Value4",
"Column2": "Value5",
"Column3": "Value6"
}
]- WordPress 5.0 or higher
- FlowMattic plugin installed and activated
- PHP 8.1 or higher
- PHP extensions: zip, xml, gd, mbstring
Convert uploaded XLSX files to CSV format for processing or import into other systems.
Extract data from XLSX files as JSON for API integrations or database operations.
Combine with other FlowMattic actions to:
- Upload XLSX file
- Convert to CSV/JSON
- Process the data
- Store in database or send to external service
- Ensure the plugin is activated
- Check that FlowMattic is properly installed
- Verify the file URL is accessible
- Check that the file is a valid XLSX format
- Ensure sufficient server memory for large files
- Check if the XLSX file has data
- Verify the file permissions allow reading
For issues or questions, please open an issue on the GitHub repository.
This plugin is provided as-is for use with FlowMattic workflows.
Built with:
Built For: