CSV transforms agent
Use an AI agent to reshape CSV lists to match your template's requirements.
CSV transforms agent uses an AI agent to reshape one or more CSV lists so they match the requirements of a target template — remapping columns, renaming headers, and reformatting values. The agent writes the transformation code for you, based on your instructions and the template's expected structure.
Availability: Requires the
WorkflowsCsvAgentfeature. Contact your OneSchema support representative if you do not see this transform.
What it does
- Input: one or more CSV lists.
- Output: one or more CSV lists, reshaped to match your target template's requirements.
- The agent generates code that maps and transforms the input columns into the shape your template expects, based on your prompt and the template's column definitions.
When to use it
- Your source CSV's column names, order, or formatting differ from your target template.
- You receive recurring vendor files with slightly different layouts each time and want AI to handle minor variation.
- You'd rather describe the mapping in plain language than write mapping code by hand.
How to configure it
Add a CSV transforms agent node after the node that produces the CSV list you want to reshape. Select the target template on the node, then click Start a chat and describe the mapping you want in the chat prompt.
Settings
| Setting | Description | Default |
|---|---|---|
| Template | The target template whose columns, types, and rules the output should match. Can be a OneSchema template or an output from a Template transforms agent. | None selected |
| Prompt | The mapping instructions you type in the agent chat. The agent uses them to generate the Code. | Empty |
| Code | The code the agent generated to perform the mapping. Starts as a pass-through snippet; edit it directly or ask the agent to regenerate it. | Pass-through code snippet |
Example
Input
A CSV with columns Emp ID, Full Name, Dept.
Output
A CSV matching your template's columns: Employee ID, Name, Department.
Troubleshooting
Agent maps columns incorrectly
- Add more detail to your prompt describing how each source column should map to the template.
- Add clearer column descriptions in your target template so the agent has more context.
Rows are dropped or altered unexpectedly
- Review the generated code for filtering logic the agent may have added.
- Regenerate the code with a prompt that explicitly says to keep all rows.
See also
Updated 1 day ago