Salesforce flows are incredibly powerful tool when it comes to automation in salesforce.Salesforce flows gives immense flexibility and power to the admins to solve complex business problems and enable them to propose solutions which are easy to build, robust and low on maintenance.
We can leverage salesforce flows to address one such business use - Creating customers when a customer raises a case by sending an email to salesforce. We can extend the same scenario for cases which are created by Web to case.
Business Requirement
Whenever a new case is created using Email-To-Case in salesforce, a new account and a contact should be created as well. Agents need not create contact as it hinders their productivity. If there are multiple matching contacts, only then the agent needs to select the appropriate contact.
Solution Proposition
We need to consider three scenarios while defining the solution.
If there are no contacts in the system with the matching email address, a new contact needs to be created.
If there is a contact record with the matching email address, the contact needs to be associated with the case.
If there are multiple contacts available with the given email address, neither a contact to be created nor any contact to be associated with the case.
Following should be the proposed solution considering the above scenarios:
Salesforce Flow: We will use salesforce flow for the first scenario.
Salesforce Standard functionality: Nothing needs to be done as Salesforce standard functionality works exactly that way.
Manual Process: Agents need to manually associate the contact with the case. No automation will be required.
Designing the Salesforce Flow
We will require the following elements in our flow:
Step 1: We need to query the contact records and match them against the SuppliedEmail field from the case.
Step 2: We need to check the number of matching contacts based on the email id(SuppliedEmail)
Step 3: If the count is less than 1 (which means there are no contacts found),we will create the account first and then create the contact.
Step 4: Create the account and then create the contact.
Step 5: Update the case with the newly created account and contact.
Imagination and problem solving are limitless. The above use case is one such use-case which could be extended to solve multitude of business problems.
Please feel free to let me know in the comments section if the above post was helpful.