Skip to content

Delete Row Data Action: deleteRowData

The deleteRowData action is used to delete a specific row from a CSV file based on the given row number. The updated file, with the specified row removed, is saved at the provided output path.

Note: Ensure that the file being used is not open during the execution of the Case to avoid errors or conflicts.

Example: Suppose you have a CSV file named EmployeeRecords.csv, located at C:\Data, with the following data:

scrn-delete-row-command-employee-records-csv
EmployeeRecords.csv

You want to delete the fourth row (row index 3, as indexing starts at 0) and save the updated file as UpdatedEmployeeRecords.csv.

Steps to Configure:

  1. Select Set a Variable Value from the Action dropdown.
  2. Enter a variable name in the Element Key field (e.g., DeleteStatus). This variable will store the result of the operation (true if successful, false if not).
  3. Click on Form, select Functions, and choose CSVHANDLE.
  4. In the Action field, select deleteRowData and provide the following parameters:
    • FPath: Specify the path to the source CSV file (e.g., C:\Data\EmployeeRecords.csv).
    • OutPath: Specify the path to save the updated file (e.g., C:\Data\UpdatedEmployeeRecords.csv).
    • rowNumber: Enter the row index to delete (e.g., 3 for the fourth row).
  5. Click Save.
scrn-delete-row-data-command-tabular-view
Tabular View
scrn-delete-row-data-command-card-view
Card View

Outcome on Execution:

  • The specified row (e.g., row 3: 103 Michael Lee Sales) is removed from the CSV file.
scrn-delete-row-data-updated-employee-records-csv
UpdatedEmployeeRecords.csv
  • The updated file is saved at the location specified in the OutPath parameter (e.g., C:\Data\UpdatedEmployeeRecords.csv).
  • If the operation is successful, the variable (e.g., DeleteStatus) stores true. If the operation fails (e.g., invalid file path or row index), the variable stores false.
  • This variable can be referenced in subsequent steps using the syntax ${VariableName} (e.g., ${DeleteStatus}).

Back To Top