Summary:
Guidance on how to create a Salesforce Flow to automatically remove companies from a monitoring portfolio if they meet certain criteria.
In the example for this article, records with the billing company of Great Britain will be removed from the selected portfolio.
Solution:
For more guidance on how to Create a Salesforce Flow to Auto Add a Company to a Monitoring Portfolio, please view this interactive demonstration.
You can also follow the below steps to create the flow:
- In your Salesforce setup area, navigate to Flows. This can be done by searching "Flows" in the Quick Find box on the top left of the screen.
- Click on New Flow on the top right of the screen
- Choose your flow creation option. In this example, we are choosing Start From Scratch
- Click Next
- Select the Type of Flow. In this example, we are using a Record-Triggered Flow
- Start configuring your flow triggers, for the flow we are creating we will be setting the following configurations:
- Object: Any standard or custom object that has a related lookup to an Account*
- Trigger the Flow When: A record is created or updated*
- Set Entry Conditions - Condition Requirements: All Conditions Are Met (AND)*
- Field: BillingCountry*
- Operator: Equals*
- Value: GB*
- When to Run the Flow for Updated Records: Only when a record us updated to meet the condition requirements*
- Actions and Related Records ticked
- Tick the Run Asynchronously path field. Apex Actions will only trigger if the process runs asynchronously
- Click Save
- Name your Flow
- Click Save
- In Run Asynchronously section of the flow, click the + button that sits above the End action
- Add in a new element here. For this example, we are using the Assignment option
- Name the assignment
- Set the variable values of the assignment, for the flow we are creating, we will be setting the following configurations:
- Variable: Select New Resource
- Resource Type: Variable
- API Name: ConnectIDs
- Data Type: Text
- Allow Collection - enabled
- Click Done
- Operator: Add
- Value: In this example we are using the Triggering Account's Connect ID. Search Triggering Account, then select Connect ID. When added this will read "Triggering Account > Connect ID".
- Variable: Select New Resource
- Add a second action here. Click on the + button again
- Select the Action option, this has a lightening bolt symbol
- Search CS in the actions
- Select "Delete Companies from Portfolio"
- Name the action
- In the Input action field, find the ConnectIDs Collection Variable
- Enter the Portfolio ID. You can find the Portfolio ID by going to the Monitoring tab and viewing the portfolio
- Click Save
- Click Activate