Orchestration
...
Native Actions
CSV Get Rows
17 min
the csv get rows native action is designed to extract data from a csv file based on user defined configurations this action allows precise control over which rows and columns to retrieve from the csv file, making it ideal for processing large csv files in chunks or extracting specific data subsets key benefits native action integrated directly into the playbook builder for streamlined workflow creation efficient processing skips rows before the offset without reading them into memory, optimizing performance for large files flexible column selection include specific columns or exclude unwanted columns from results pagination support use offset and limit to process large files in manageable chunks error handling option to continue processing even when individual rows have errors at least once execution ensures data is retrieved even if the playbook is retried inputs the csv get rows action requires the following inputs required inputs attachment the csv file attachment to process this can be an attachment from an upstream action (e g , export records action output) an attachment from playbook inputs an attachment reference using expressions note the attachment must be a valid csv file the action automatically detects and skips the header row optional inputs offset the number of data rows to skip before starting to return rows default 0 (starts from the first data row) minimum 0 note the header row is automatically skipped and does not count toward the offset offset 0 means start from the first data row after the header limit the maximum number of rows to return default 0 or null (returns all rows from offset to end of file) minimum 0 note if limit is 0 or not specified, all remaining rows from the offset position are returned return columns an array of column names to include in the result default all columns are included if not specified format array of strings (column names must match csv header exactly, case sensitive) note if specified, only these columns are included in the output (unless also specified in omit columns) omit columns an array of column names to exclude from the result default no columns are omitted if not specified format array of strings (column names must match csv header exactly, case sensitive) note omit columns is applied after return columns if both are specified, return columns is applied first, then omit columns filters out any matching columns continue on error whether to continue processing if an error occurs while reading a row default false options true continue processing remaining rows even if individual rows have errors errors are collected and returned in the output false stop processing immediately when an error occurs and throw an exception column selection logic when both return columns and omit columns are specified first, return columns filters which columns to include then, omit columns removes any columns that match the omit list if a column appears in both lists, it will be excluded (omit columns takes precedence) example if return columns = \["a", "b", "c"] and omit columns = \["c"], the result will include only columns a and b column name matching column names are case sensitive and must match the csv header exactly ensure column names in return columns and omit columns match the header row precisely configuring the csv get rows action step 1 select attachment from the inputs tab, select the csv file attachment use the select a property button to choose an attachment from upstream actions reference attachments using expressions (e g , $actions exportrecordsname result exportfile ) use playbook input attachments step 2 configure row selection offset set the number of data rows to skip (default 0) offset 0 = start from first data row offset 10 = skip first 10 data rows, start from 11th row limit set the maximum number of rows to return (default 0 = all rows) limit 100 = return up to 100 rows limit 0 = return all remaining rows from offset example to get rows 11 110 set offset to 10 set limit to 100 step 3 configure column selection (optional) return columns click add array item to specify columns to include enter column names exactly as they appear in the csv header column names are case sensitive if not specified, all columns are included omit columns click add array item to specify columns to exclude enter column names exactly as they appear in the csv header column names are case sensitive applied after return columns filtering step 4 configure error handling (optional) continue on error choose error handling behavior false (default) stop processing on first error true continue processing and collect errors in output step 5 apply changes click apply to save your configuration outputs the csv get rows action provides the following outputs success output when the action completes successfully, it returns result data an array of objects, where each object represents a row from the csv file each object has properties corresponding to column names values are strings (as read from csv) empty cells are represented as empty strings result count the number of rows returned in this operation result nextoffset the next offset value that should be used to fetch the next page of results calculated as currentoffset + count useful for pagination through large files if all rows have been processed, nextoffset will be equal to or greater than the total rows result error (optional) error information if continueonerror is true and errors occurred error total total number of errors encountered error errors array of error objects, each containing row the row number (0 based, excluding header) where the error occurred message the error message describing what went wrong example access csv data in downstream actions \# access all rows $actions csvgetrowsname result data \# access first row $actions csvgetrowsname result data\[0] \# access a specific column value from first row $actions csvgetrowsname result data\[0] transactionid \# get row count $actions csvgetrowsname result count \# get next offset for pagination $actions csvgetrowsname result nextoffset \# check for errors $actions csvgetrowsname result error total error output if the action fails (and continueonerror is false), the action returns error error information containing details about why the action failed common error scenarios invalid csv file format file attachment not found invalid offset or limit values column names not found in csv header invalid data in a row (when continueonerror is false) use cases example 1 extract first 100 rows scenario process the first 100 rows of a csv file configuration attachment select csv file offset 0 limit 100 return columns leave empty (return all columns) result returns the first 100 data rows with all columns example 2 paginate through large file scenario process a large csv file in chunks of 1000 rows configuration (first page) attachment select csv file offset 0 limit 1000 result returns rows 1 1000, with nextoffset = 1000 configuration (second page) attachment same csv file offset use $actions csvgetrowsname result nextoffset (1000) limit 1000 result returns rows 1001 2000, with nextoffset = 2000 note use a loop action to iterate through all pages until nextoffset indicates all rows have been processed example 3 extract specific columns scenario extract only transaction id and amount columns from a csv file configuration attachment select csv file offset 0 limit 0 (all rows) return columns add "transactionid" add "amount" result returns all rows with only transactionid and amount columns example 4 skip header and extract subset scenario skip the first 10 data rows and retrieve the next 100 rows with specific columns configuration attachment select csv file offset 10 limit 100 return columns add "transactionid" add "amount" add "date" result returns rows 11 110 with only the specified columns example 5 exclude columns scenario return all columns except sensitive data columns configuration attachment select csv file offset 0 limit 0 (all rows) omit columns add "ssn" add "creditcard" add "password" result returns all rows with all columns except the omitted ones example 6 handle errors gracefully scenario process a csv file that may have some invalid rows, but continue processing the rest configuration attachment select csv file offset 0 limit 0 (all rows) continue on error true result returns all valid rows, with error information in result error for any rows that failed to process access errors \# check total errors $actions csvgetrowsname result error total \# access error details $actions csvgetrowsname result error errors\[0] row $actions csvgetrowsname result error errors\[0] message best practices use pagination for large files for very large csv files, use offset and limit to process in manageable chunks use nextoffset to track your position validate column names ensure column names in return columns and omit columns match the csv header exactly (case sensitive) handle missing columns if a column specified in return columns doesn't exist in the csv, it will be omitted from results without error use continue on error for data quality issues if your csv may have some invalid rows but you want to process the rest, set continueonerror to true and check the error output optimize column selection use return columns or omit columns to reduce data size and improve performance, especially for large files combine with export records use csv get rows to process csv files exported by the export records action export records → csv get rows → process data loop through pages use a loop action with a while condition to process all pages while $actions csvgetrowsname result nextoffset < totalrows validate file format ensure the csv file is properly formatted with a header row the action automatically skips the header row troubleshooting no rows returned check that the offset is not greater than the number of data rows in the file verify the csv file has data rows (not just a header) ensure the attachment is a valid csv file column not found verify column names match the csv header exactly (case sensitive) check for extra spaces or special characters in column names ensure the csv file has a header row invalid offset or limit offset must be >= 0 limit must be >= 0 verify values are numbers, not strings processing errors if continueonerror is false, check the error output for details if continueonerror is true, check result error for row specific errors verify csv file format is valid (proper quoting, escaping, etc ) empty results check that return columns doesn't exclude all columns verify omit columns doesn't omit all columns ensure there are data rows after the offset position pagination issues use nextoffset from the previous call as the offset for the next call check that nextoffset is less than the total number of rows verify limit is set appropriately for pagination file attachment errors ensure the attachment exists and is accessible verify the attachment is a csv file (not another format) check that the attachment reference is correct (e g , $actions actionname result exportfile )