Skip to main content

Flow 4: Sync Line Item Deletion

This flow fires when a product is removed from the Opportunity. It deletes the matching row from the Opportunity Products data sheet using the async variant of the Delete Rows by Criteria action.

Complete product line item deletion sync flow

Create the Flow

  1. Go to Setup > Flows > New Flow.
  2. Select Record-Triggered Flow.
  3. Configure the trigger:
    • Object: Opportunity Product (OpportunityLineItem)
    • Trigger the flow when: A record is deleted

Check for Calculator

  1. Add a Decision element same as in the line item creation flow. It makes sure nothing is executed if there is no calculator spreadsheet.

Delete the Row

  1. Create a formula resource:

CriteriaJson (Text) - see Row Matching Criteria for the full criteria format reference.

'{"conditions":[{"column": "A","operator":"=","value":"' & {!$Record.Id} & '"}]}'

CriteriaJson formula configuration

  1. Add an Action element:
    • Action: Delete Rows by Criteria (Async) (DriveMate)
    • Spreadsheet ID: {!$Record.Opportunity.SalesCalculatorSpreadsheetId__c}
    • Sheet Name: Opportunity Products
    • Criteria: {!CriteriaJson}

Delete Rows by Criteria action configuration

Why the Async variant?

Record-triggered flows that fire on deletion do not support asynchronous paths. This means you cannot use actions that make synchronous callouts. The Delete Rows by Criteria (Async) variant queues the callout in a separate transaction, working around this platform limitation.

  1. Save the flow as Sales Calculator: Sync Product Items Deletions and Activate it.