Here's an example configuration that shows both basic and advanced features:
{
"sheets": [
{
"sheetName": "Windows",
"startRow": 8,
"records": [
{
"column_letter": "A",
"output_name": "Project ID",
"php_code_snippet": "strtoupper({{CURRENT}})",
"include_in_all_records": true
},
{
"column_letter": "B",
"output_name": "Location",
"include_in_all_records": true
},
{
"column_letter": "C",
"output_name": "Employee Assigned to ID"
},
{
"column_letter": "D",
"output_name": "Employee Code"
}
],
"includeSheetName": true
},
{
"sheetName": "Flooring",
"startRow": 12,
"global_values": [
{
"value_from": "cell",
"field": "company_name",
"cell": "A1",
"show_in_output": true,
"include_in_all_records": true
},
{
"value_from": "code_snippet",
"field": "project_code",
"cell": "A7",
"php_code_snippet": "empty({{A7}}) ? '' : strtok({{A7}}, ' ')",
"show_in_output": true,
"include_in_all_records": true
},
{
"value_from": "code_snippet",
"field": "project_title",
"cell": "A7",
"php_code_snippet": "preg_match('/-(.*?)--/', {{A7}}, $match) ? trim($match[1]) : ''",
"show_in_output": true,
"include_in_all_records": true
}
],
"records": [
{
"column_letter": "A",
"output_name": "Project ID 2"
},
{
"column_letter": "B",
"output_name": "Location 2",
"php_code_snippet": "{{CURRENT}} . ' (Row ' . {{ROW}} . ')'"
},
{
"column_letter": "C",
"output_name": "Employee Assigned to ID 2"
},
{
"column_letter": "D",
"output_name": "Employee Code 2"
}
],
"includeSheetName": true
}
],
"global": {
"source": "imported_from_excel",
"company_name": "ABC Group"
}
}
Advanced Features:
- records: New format with per-column PHP code execution
- include_in_all_records: Ensures field appears in every output record across ALL sheets
- {{CURRENT}}: Current cell value in PHP code
- {{ROW}}: Current row number
- {{COLUMN}}: Current column letter
- global_values: Extract values from specific cells
- Cell references: Use {{A7}} in PHP code to access any cell
- show_in_output: Include values in every record from this sheet