The CSV Action
Thecsv action block parses CSV-formatted text into an array of objects.
- Input: Takes a raw CSV string in the
valuefield. If empty, it usesblock.outputfrom the previous step. - Output: The resulting array is stored in a variable of your choice (via
varName). - Header Mapping: Automatically uses the first row of the CSV as keys for the objects.
Common Use Cases
- Bulk Registration: Drive a signup task with a CSV list of user details.
- Automated Search: Perform searches for a list of keywords or product SKUs.
- Data Enrichment: Update a local dataset by visiting URLs and extracting information.
Workflow Example
- Extract Data: Use a
javascriptblock to read a CSV file’s content or fetch it from a URL. - Parse CSV: Add a
csvaction, setting thevarNametobulkData. - Iterate: Use a
foreachaction with the selectorbulkData(or a variable reference). - Execute: Inside the loop, use
{$loop.item.column_name}to access specific fields for each row.
Tips
- Quoting: Ensure your CSV data uses standard quoting if fields contain commas or newlines.
- Empty Rows: Figranium automatically filters out empty rows to prevent execution errors.