CMS - Complaints CSV Upload
Overview
The Complaints Management CSV Upload system allows you to upload and manage complaint flow data using two CSV files - one in English and one in Arabic. This system provides validation, preview functionality, and error handling to ensure data integrity.
Code Reference Legend
Actions
| Code | Definition |
|---|---|
| X | Go to next node |
| Q | Question to a customer |
| QP | Ask for proof to a customer, upload picture |
| S | Show customer order to pick an item |
| CB | Call back to customer |
| R | Refund |
| R30 | 30% refund of the item in default |
| T | Rating |
| TT | Ticket Transfer to agent for manual evaluation |
| QD | Dialog box |
| QPD | Both Dialog Box and Picture upload |
| PHONE | Provide phone number of the delivery partner in the variable field {%phone%} |
| R100P150 | 100% refund of the order value, up to 150 SAR |
Status
| Code | Definition |
|---|---|
| CA | Closed Abandoned |
| C | Closed |
| O | Open |
Conditions
| Code | Definition |
|---|---|
| NOPHONE | Driver phone number is not available |
| YESPHONE | Driver phone number is available |
| RP | Platinum Guarantee Refund Processed |
| RNP | Refund Guarantee Refund Not Processed |
| GSE | Gold Subscription Expired |
| GSNE | Gold Subscription Not Expired |
| GTP | Customer moved from Gold to Platinum |
| PSE | Platinum Subscription Expired |
| PSNE | Platinum Subscription Not Expired |
| SLABD30 | Delivery SLA Breached - Platinum Guarantee of 30 mins from theoretical start production time to at customer location |
| NOSLAB30 | Platinum delivery guarantee SLA of 30 mins not breached |
| SLABPU15 | Pickup SLA breached - Platinum guarantee of 15 mins from theoretical start production time to actual end production time |
| NOSLAB15 | Platinum pickup guarantee SLA of 15 mins not breached |
| SLABD | Delivery SLA breach (SLA = 40 mins) |
| SLABPU | Pickup SLA breach (SLA = 15 mins) |
| N | No Condition |
| ITEMCHECKS | Item selected from the order should be a side dish only |
| NOSLAB | No SLA Breach in Pickup or Delivery |
| CHECKCUSTY | Customizations are added in the Pizza |
| CHECKCUSTN | Customizations are not added in the Pizza |
| ORSPT | Order is Pickup or Takeaway |
| ORSD | Order is Delivery |
| SLABD20 | Time breach after the SLA time is between 1 min to 20 mins |
| SLABD2035 | Time breach after the SLA time is above 20 mins and below 35 mins |
| SLABD3550 | Time breach after the SLA time is above 35 mins and below 50 mins |
| SLABD50+ | Time breach after the SLA time is above 50 mins |
| WMP | Wallet balance is present in the account |
| WMPF | Wallet balance is 0 |
| EXEMPT | If refund is given with Exempt in Action, that refund should not be counted in future customer profiling |
Variables
| Code | English | Arabic |
|---|---|---|
{%wallet%} |
(%AMOUNT%) in your wallet | (%AMOUNT%) في محفظتك. |
{%wallet%} |
(%Loyalty Points%) rewards points | (%Loyalty Points%) نقطة مكافأة. |
{%wallet%} |
(%AMOUNT%) in your wallet & (%Loyalty Points%) rewards points | (%AMOUNT%) في محفظتك و (%Loyalty Points%) نقطة مكافأة. |
{%currency%} |
SAR | ريال سعودي. |
{%currency%} |
AED | درهم إماراتي. |
Loyalty Tiers
| Code | Definition |
|---|---|
| S | Silver |
| G | Gold |
| P | Platinum |
Customer Types
| Code | Definition |
|---|---|
| H | Healthy |
| A | Alert |
| B | Abusive |
Upload Process Workflow
1. File Selection
- English CSV: Upload the main complaint flow structure with all node data
- Arabic CSV: Upload the Arabic translations for node descriptions
- File Format: Only
.csvfiles are accepted - Requirement: Both files must be selected before proceeding
2. File Validation
The system performs comprehensive validation in the following order:
- Format Validation: Checks file structure and required columns
- Data Validation: Validates data types and required fields
- Flow Validation: Verifies the logical flow of complaint processes
3. Upload Execution
- Files are uploaded to test database tables
- Existing data for the selected brand complaints is replaced with new data
- Transaction-based upload ensures data consistency
File Format Requirements
English CSV Structure
Required columns (case-sensitive):
NODE_ID- Numeric identifier (required, unique)CUST_ID- Customer ID (numeric, required)PARENT_NODE_ID- Parent node reference (numeric or NULL)DESCRIPTION- Node description in English (required, non-empty)SHORT_NAME- Short display name (required)CUSTOMER_TYPE- Customer type classificationLOYALTY_TIER- Loyalty level indicatorACTION- Action type for this nodeCONDITION- Conditional logic (if applicable)LAST_NODE- End node indicatorSTATUS- Node status
Column Separator: Semicolon (;)
Arabic CSV Structure
Required columns (case-sensitive):
NODE_ID- Must match English CSV NODE_ID (numeric, required)CUST_ID- Must match English CSV CUST_ID (numeric, required)PARENT_NODE_ID- Parent node reference (numeric or NULL)Description (Arabic)- Arabic translation (required, non-empty)SHORT_NAME- Short name in Arabic
Column Separator: Semicolon (;)
Validation Process
Step 1: File Format Validation
The system checks:
- ✅ File contains headers and at least one data row
- ✅ All required columns are present
- ✅ Column count matches across all rows
- ✅ File encoding is UTF-8 compatible
Common Format Errors:
- Missing required columns
- Incorrect column separator (must be
;) - Empty files or header-only files
- Mismatched column count between rows
Step 2: Data Type Validation
The system validates:
- ✅
NODE_IDis numeric - ✅
CUST_IDis numeric - ✅
PARENT_NODE_IDis numeric or NULL - ✅ Required text fields are not empty
- ✅ Arabic descriptions contain valid text
Common Data Errors:
- Non-numeric values in ID fields
- Empty description fields
- Invalid character encoding
- Missing required field values
Step 3: Flow Validation
Advanced validation checks:
- ✅ Node hierarchy integrity
- ✅ Parent-child relationships
- ✅ Circular reference detection
- ✅ End node validation
- ✅ Action type consistency
- ✅ Variable pattern validation
Upload Status Indicators
File Status Icons
- 🔄 Validating: File validation in progress
- ✅ Validated: File passed all validation checks
- ⏳ Waiting: File queued for validation
- ⚠️ Warning: File selected but not validated
- ❌ Error: Validation failed
Upload Status Messages
- 📤 "Uploading": Files are being processed on server
- ✅ "Files uploaded successfully": Upload completed without errors
- ❌ "Upload failed": Server error during upload process
Error Messages and Solutions
File Selection Errors
| Error | Solution |
|---|---|
| "Select both English and Arabic CSV files" | User must select both English and Arabic CSV files |
| "Both files must be validated" | Click "Validate Files" after selecting both files |
Format Validation Errors
| Error | Cause | Solution |
|---|---|---|
| "File must contain header and at least one data row" | Empty file or missing data | Ensure file has header row and data rows |
| "Missing required column: [COLUMN_NAME]" | Required column not found | Add missing column to CSV header |
| "Row X: Column count mismatch" | Inconsistent number of columns | Ensure all rows have same number of columns |
| "Error reading CSV file" | File corruption or encoding issue | Re-save file as UTF-8 CSV with semicolon separator |
Data Validation Errors
| Error | Cause | Solution |
|---|---|---|
| "Row X: NODE_ID must be numeric" | Non-numeric NODE_ID | Ensure NODE_ID contains only numbers |
| "Row X: CUST_ID must be numeric" | Non-numeric CUST_ID | Ensure CUST_ID contains only numbers |
| "Row X: PARENT_NODE_ID must be numeric or NULL" | Invalid parent reference | Use numbers or exactly "NULL" |
| "Row X: Arabic description is required" | Missing Arabic text | Add Arabic description for all nodes |
Server Processing Errors
| Error | Cause | Solution |
|---|---|---|
| "No valid English CSV data found" | Empty or invalid English file | Check English file format and data |
| "No valid Arabic CSV data found" | Empty or invalid Arabic file | Check Arabic file format and data |
| "English CSV row X: Invalid NODE_ID" | Server-side validation failure | Review NODE_ID format and uniqueness |
| "Arabic CSV row X: Missing Description (Arabic)" | Server-side validation failure | Ensure all Arabic descriptions are present |
| "Maximum 2 files allowed" | Too many files uploaded | Upload exactly 2 files (English + Arabic) |
Flow Validation Errors
| Error | Cause | Solution |
|---|---|---|
| "The flow of both files must be validated" | Flow validation not performed | Click "Validate Flow" button |
| "The files have flow validation errors that must be corrected" | Flow validation found issues | Review flow validation dialog for specific errors |
Troubleshooting Guide
Problem: Files won't upload
Check:
- Both files selected
- Both files validated successfully
- Flow validation completed without errors
- Correct brand selected
Problem: Validation fails repeatedly
Solutions:
- Download current data to see expected format
- Check file encoding (must be UTF-8)
- Verify column separator is semicolon (
;) - Ensure no hidden characters or formatting
Problem: Flow validation shows errors
Actions:
- Open flow validation dialog
- Review specific error messages
- Check parent-child relationships in data
- Verify node hierarchy integrity
- Correct data and re-validate
Problem: Upload fails after validation
Investigation:
- Check server connection
- Verify file size limits
- Review browser console for errors
- Contact system administrator if issues persist
Technical Notes
System Behavior
- Environment: CSV uploads always to test environment
- Data replacement: Existing complaints data is completely replaced when uploading a CSV in the test environment
- Transaction safety: Failed uploads don't corrupt existing data
- File processing: Files processed sequentially during validation
- Memory limits: Large files may cause browser performance issues
Best Practices
File Preparation
- Use consistent encoding: Save CSV files as UTF-8
- Check separators: Use semicolon (
;) as column separator - Validate NODE_IDs: Ensure matching NODE_IDs between English and Arabic files
- Review descriptions: Verify all descriptions are meaningful and complete
Error Prevention
- Template usage: Use existing data export as template for new uploads
- Data validation: Check data in spreadsheet application before export
- Backup strategy: Keep original files as backup before processing
- Test with small dataset: Validate process with subset of data first
Upload Strategy
- Sequential validation: Complete file validation before flow validation
- Review before upload: Check all validation messages before final upload
- Brand selection: Verify correct brand is selected before upload
- Timing: Perform uploads during low-traffic periods