Lead country and assignment

Send2CRM sessions may contain a country code inferred from the visitor’s IP address lookup. This page outlines one way that it may be used to better qualify Leads, and assign them to the appropriate user or queue.

Send2CRM has a configuration option to enable default Assignment Rules out-of-the-box. However sometimes the data you need to perform assignment isn’t available from a form submission and needs to occur at a later time.

Enable Country Picklist

Follow the Salesforce documentation to enable the country picklist for addresses. This allows using the standard CountryCode field with ISO codes.

https://help.salesforce.com/s/articleView?id=sf.admin_state_country_picklist_enable.htm&type=5

Flow to set Country and re-run Assignment Rules

Create a new record-triggered Flow:

  • Object: Session (send2crm__s2cSession__c)

  • Trigger the Flow When: A record is created or updated

  • Entry Conditions: send2crm__Country__c Is Null = False

  • Only when a record is updated to meet the condition requirements

  1. Add a Decision element with conditions to determine whether the country should be updated. For example:

    • Lead on the related visitor record is not blank

    • Lead is not converted

    • Lead country is blank

Each Send2CRM session may have a different country, for example if the visitor is traveling. You may wish to place additional restrictions for greater confidence, e.g. minimum number of sessions with the same country.

  1. Add an Update Records element.

    • Set the CountryCode field on the related Lead to the value from the session record.

  2. Add an Apply Lead Assignment Rules action.

    • Set the Lead Id input value to the value from the related visitor.

image-20241007-012447.png

The Flow shown has a Fault Path from the Update Records element. This runs an empty Assignment so that an invalid country code does not block creating the session record.

Configure Lead Assignment Rules

Create active Lead Assignment Rules to route your Leads to the appropriate user or queue based on the country.

Alternatively further refinement may be required. For example countries may be grouped into regions. One way this may be achieved is with a custom formula field that references the country.