csv-bulk-import
Automates CSV bulk import operations for TaskActivity and Expense records using the Import-CsvData.ps1 script with proper authentication and validation
Installation
Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.
View source ↗GuidesSkill instructions
CSV Bulk Import Skill
This skill helps with bulk CSV import operations for TaskActivity and Expense records.
When to Use
- User wants to bulk import TaskActivity or Expense records
- User needs help with CSV formatting or templates
- User encounters CSV import errors
Prerequisites Check
Before importing:
- ✅ User has ADMIN or MANAGER role
- ✅ JWT token is available or can be generated
- ✅ CSV file follows correct template format
- ✅ Database is accessible
CSV Templates
TaskActivity Template (docs/taskactivity-import-template.csv):
Date,Hours,Client,Project,Phase,Description,Username
2026-01-15,8.0,Acme Corp,Website Redesign,Development,Implemented user authentication,admin
Expense Template (docs/expense-import-template.csv):
Date,Amount,Description,ExpenseType,Vendor,PaymentMethod,Username
2026-01-15,125.50,Hotel accommodation,Travel,Marriott,CreditCard,admin
Import Process
Step 1: Validate CSV File
Check for:
- Correct headers (case-sensitive)
- Date format: YYYY-MM-DD
- Hours/Amount: Positive numbers
- Required fields: Not empty
- References: Client, Project, Phase, ExpenseType exist in DropdownValues
Step 2: Generate/Obtain JWT Token
# If needed, generate token
.\scripts\generate-token.ps1 -Username "admin" -Password "password"
Step 3: Run Import Script
.\scripts\Import-CsvData.ps1 `
-CsvFilePath "path\to\import.csv" `
-ImportType "TaskActivity" `
-JwtToken "your-jwt-token" `
-BaseUrl "http://localhost:8080"
Step 4: Verify Import
- Check console output for success/error messages
- Review import log for details
- Query database to confirm records
Common Issues and Solutions
Issue: "Invalid date format"
- Solution: Ensure dates are in YYYY-MM-DD format
Issue: "Client not found"
- Solution: Add missing DropdownValue or enable auto-creation in CsvImportService
Issue: "Unauthorized (401)"
- Solution: Token expired - generate new JWT token
Issue: "Headers don't match template"
- Solution: Verify CSV headers match template exactly (case-sensitive)
Memory Bank References
- Check
ai/common-patterns.mdfor CSV import code patterns - Check
ai/project-overview.mdfor CSV import feature details - Check
docs/CSV_Import_User_Guide.mdfor comprehensive documentation
Output Format
Always provide:
- Pre-import validation results
- PowerShell command to run
- Expected outcome
- Verification steps
- Rollback instructions if needed
Examples
Read the usage examples in the source repository.
View source ↗Source history
- Indexed on
- 2026-01-20
- Index updated
- 2026-01-26
- Branch
- main
Index and sync dates describe this directory. View the source repository for code history.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!