Link Menu Expand (external link) Document Search Copy Copied

Delete Rows

Definition

The Delete Rows action in Smartsheet allows you to permanently remove one or more specific rows from a designated sheet within your Smartsheet account. This action is critical for maintaining data hygiene, archiving processes, and managing workflow lifecycles by removing obsolete or processed data. Key capabilities include:

  • Targeting a specific sheet within your workspace.
  • Deleting a single row or multiple rows simultaneously using their unique identifiers.
  • Integrating with search actions to dynamically identify and remove data based on specific criteria.

This action enables you to automate the cleanup of your sheets, ensuring your data remains relevant and up-to-date without manual intervention.



Inputs

1. Connection

  • Purpose: This field establishes the link between Zenphi and your Smartsheet account, authorizing the action to modify your data.
  • Practical Guidance: Select an existing Smartsheet connection from the dropdown list. If you have not connected yet, you will need to create a new connection by authorizing Zenphi to access your Smartsheet environment.
  • Use Case Context: You use this to ensure the action has the necessary permissions to delete data in your specific account.

2. Sheet ID

  • Purpose: This field identifies the specific Smartsheet document where the rows are located.
  • Practical Guidance: Select the specific sheet directly from the dropdown list, which populates once the connection is established. (Note: As with all Smartsheet actions in Zenphi, the sheet must be selected from the dropdown menu).
  • Use Case Context: You would use this to tell Zenphi, “Go to the ‘Q3 Sales Report’ sheet to perform this deletion.”

3. Row IDs

  • Purpose: This field specifies exactly which rows should be deleted from the selected sheet.
  • Practical Guidance:
    • Dynamic Approach (Recommended): In most automations, you will not know the ID beforehand. You should use the token picker to map the Row ID output from a previous action, such as List Rows or Find Row. If passing multiple IDs, ensure they are passed as a collection or comma-separated list.
    • Static Approach: You can manually paste IDs here. To find a Row ID manually, right-click a row in the Smartsheet web app, select “Properties,” and copy the Row ID.
  • Use Case Context: You would use this to delete a row automatically after its status column has been changed to “Archived” or “Rejected.”



Example Use Cases

1. Archive Rejected Requests: Automatically remove rows marked as “Rejected” or “Cancelled” from an active tracking sheet after copying them to an archive log.

2. GDPR Data Compliance: Permanently delete customer information rows from a database sheet upon request or after a specific retention period expires.

3. Remove Duplicate Entries: Delete rows identified as duplicates during a data cleansing workflow to ensure reporting accuracy.

4. Clean Up Temporary Data: Remove placeholder rows or temporary staging data used during complex calculation processes once the final results are generated.

5. Reset Weekly Trackers: Clear specific rows from a weekly task tracker at the end of the week to prepare the sheet for the next cycle.



Example Scenario

Goal

You manage a “Purchase Requests” sheet in Smartsheet. To keep the sheet performant and focused on active tasks, you want to run a weekly maintenance job that permanently deletes any rows where the “Status” column has been set to “Declined.”


Steps to Implement

1. Scheduled Flow: Select the Scheduled Flow trigger to run this automation every Friday at 5:00 PM.

2. List Rows (Smartsheet): Add this action to retrieve the rows from your sheet.

  • Connection: Select your Smartsheet connection.
  • Sheet ID: Select the “Purchase Requests” sheet. (Note: This action retrieves the rows as raw JSON text).

3. Convert JSON to Object: Add this action to parse the raw JSON output from the List Rows step into a structured data collection.

4. Query Collection: Add this action to apply filtering on the parsed list. Configure the conditions to return only the rows where the column Status equals Declined.

5. Delete Rows: Add this action to permanently remove the filtered rows.

  • Connection: Select the same Smartsheet connection.
  • Sheet ID: Select the “Purchase Requests” sheet.
  • Row IDs: Use the token picker to select the Row ID collection output from the Query Collection action. This passes all the identified IDs into the delete action simultaneously.


Outcome

Every Friday, the workflow automatically scans the sheet, isolates the declined requests, and removes them in bulk. This keeps the active sheet uncluttered and improves loading times without requiring manual administrative effort.



Best Practices

1. Archive Before Deletion: Since this action permanently removes data, consider using a Copy Rows or Move Rows action first to save the data to a backup sheet before deleting it.

2. Use Unique Row IDs: Always map the unique Row Id (obtained from actions like List Rows or Find Row) rather than row numbers. Row numbers change as data is added or removed, whereas Row IDs remain constant.

3. Batch Your Deletions: When deleting multiple rows, pass the entire collection of IDs into the Row IDs field rather than placing the Delete Rows action inside a loop. This reduces API calls and speeds up flow execution.

4. Verify Filter Logic: When using a Query Collection action to filter your list and find rows to delete, test your logic carefully to ensure you do not accidentally select and delete active or critical data.