You are here:
Create a Flow to Delete Closed Cases
Create a business flow to automatically delete cases. All closed cases get deleted, except for medium and high priority cases that were escalated.
Required Editions
| View supported editions. |
| User Permissions Needed | |
|---|---|
| To create a business flow: | Manage Flows system permission |
-
Click
, and select
Setup.
- In the Quick Find box, search and select Flow.
- Click New Flow.
- Select Autolaunched Flow (No Trigger), and click Next.
-
Drag the Get Records action onto the canvas, and provide the
following details:
- Label: Get all case records
- Object: Case
- Condition Requirements: All Conditions Are Met
- Field: Id
- Operator: Equals
- Value: Create a Variable type resource, and select the data type as Text. Name the
variable as RecordID, and make it available as an input outside the flow.
Note This input variable helps the batch job identify each unique record that it must process.
- Click Done | Done.
- Connect the Start element with the Get Records element.
-
Drag the Decision action onto the canvas, and complete the following
steps:
-
Define the decision for the low priority cases:
- Label: Low Priority
- When to Execute Outcome: All Conditions Are Met
- Condition Requirements:
- Resource: {!Get_all_case_records.Priority}
- Operator: Equals
- Value: Low
-
Click
.
-
Define the decision for the medium and high priority cases:
- Label: High or Medium Priority
- When to Execute Outcome: All Conditions Are Met
- Condition Requirements:
- Condition 1:
- Resource: {!Get_all_case_records.Priority}
- Operator: Does Not Equal
- Value: Low
- Condition 2:
- Resource: {!Get_all_case_records.IsEscalated}
- Operator: Equals
- Value: False
- Condition 1:
-
Define the decision for the low priority cases:
- Click Done.
- Connect the Get Records element with the Decision element.
-
Drag the Delete Records action onto the canvas, and provide the
following details:
- Label: Delete Low Priority Cases
- How to Find Records to Delete: Use the IDs stored in a record variable or record collection variable.
- Record or Record Collection: {!Get_all_case_records}
- Click Done.
-
Drag another Delete Records action onto the canvas, and provide the
following details:
- Label: Delete Medium or High Not Escalated Cases
- How to Find Records to Delete: Use the IDs stored in a record variable or record collection variable.
- Record or Record Collection: {!Get_all_case_records}
- Click Done.
- Connect the two Delete elements with the Decision element.
- Click Save.
- Name the flow as Delete Closed Cases, and click Save.
- Activate the flow.
Create a batch job that processes this flow.
See Also
Did this article solve your issue?
Let us know so we can improve!
