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: 


  1. 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. 
  2. Click on New Flow on the top right of the screen
  3. Choose your flow creation option. In this example, we are choosing Start From Scratch
  4. Click Next
  5. Select the Type of Flow. In this example, we are using a Record-Triggered Flow 
  6. 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
  7. Click Save
  8. Name your Flow 
  9. Click Save
  10. In Run Asynchronously section of the flow, click the + button that sits above the End action
  11. Add in a new element here. For this example, we are using the Assignment option 
  12. Name the assignment
  13. 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".
  14. Add a second action here. Click on the + button again
  15. Select the Action option, this has a lightening bolt symbol 
  16. Search CS in the actions 
  17. 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 
  18. Click Save
  19. Click Activate