[SalesForce] Workflow Rule to send an email based on picklist value selected

I have a custom pick list field containing names of Salesforce users and non-Salesforce users. I want to create a WF rule when a record is created and a particular name is selected in the pick list than a email should be send to the person who has been selected in the pick list field.
I'm hoping to create an email alert but not sure how to create a formula to evaluate the condition.
Any help would be really appreciated.

Best Answer

I think a regular WF won't be enough in your case because once you know the name of the user/person you need to query he's id to find he's email.

So I would do it with a process builder and a flow:

  1. Go to Setup > Create > Workflow & Approvals > Process Builder:

    Create a process on you're object that will be fired on creation of a record.

    Create a step to check the value of the list:

    First check if it's not blank. Now go to the 2nd step:

  2. Go to Setup > Workflow & Approvals > Flows:

    2.1 Create a flow.

    2.2 Create a text variable with public input/output to receive the name form the process builder.

    2.3 Create another variable with same props for the found email.

    2.4 Drag a fast lookup operation to the pallet and mark it as the start point if the flow.

    Inside the fast lookup: Search your user/contact by name. If found take the email of the found record and assign to your email flow-variable.

    Now drag your email-notification to the flow pallet and assign the email var to it.

    On saving, make it an automated flow (so it could be fired from the process builder).

  3. Now return to your process builder:

    3.1 On the step that checks the picklist:

    3.2 Add an action to fire a flow.

    3.3 Pick your newly created flow.

    3.4 Assign the picklist value (the user/person name) to the flow's var.

    3.5 Save the process.

    3.6 Activate it.

And you're done!

You can find more instructions on process builder stuff in the Automated Champion blog.

Related Topic