function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sai Shanmukh 15Sai Shanmukh 15 

lead assignment based on territories using flow

How to assign lead based on territories using flow
SwethaSwetha (Salesforce Developers) 
HI Sai,

To assign leads based on territories using flow in Salesforce, you can follow these steps:

> Create a custom "Territory" field on the Lead object to store the territory value.
> Create a flow that will populate the "Territory" field on the Lead object based on the address entered.
> In the flow, use a "Get Records" element to search for any of the Country records where the name is equal to the CountryName passed over from process builder. It then stores the Territory value from the Country record it finds into the CountryTerritory flow variable.
> Use an "Update Records" element to find the Lead record in question by digging into the StartingRecord record variable, which was passed from process builder to represent the Lead record, and gets its ID. It finds the Lead record with this ID. It then updates the "Territory" field on the Lead record with the value stored in the CountryTerritory flow variable.
> Save and activate the flow.
> Use process builder to trigger the flow when a Lead record is created or updated.

Related: https://www.adminwithin.com/post/creating-territories-in-salesforce-flow
https://www.salesforceben.com/salesforce-lead-routing-solutions-an-overview/
https://help.salesforce.com/s/articleView?id=release-notes.rn_sales_features_core_territory_management_leads.htm&release=240&type=5

If this information helps, please mark the answer as best. Thank you