Ask Search:
Mit ChandolaMit Chandola 

Workflow to send email alert when specific value is selected.

Hi, 

I found that workflows that were created earlier were firing even somebody just edit any field on the contact record. . So I created rules around PickList Field - Customer Survey that will fire when specific user update the field to different picklist options (Options are kind of surveys - Kickoffs, Annual cust survey, Deployment)
 
Every plist option is tied to the email template specifically made for the kind of survey. So when specfic users, say with User id xyz01 and abc01 update the field the email goes out to the contact's email id. I created this workflow with 2nd option evtime created and edited

AND(
  ISCHANGED( Customer_Survey__c ),
  $User.Id = 'xyz01 , abc01 ')

My question is, as most of the client directors in my org are pretty busy to send out the survey, I do it - I log in as the user  and fire the workflow will that send the survey when their ids are selected but in actual they are not sending (pardon for my ignorance). 
Also, how can I tweak this formula with the specific value of the picklist so that the survey sent out for the specific event such as Deployment ?

will it be like this ?? 


AND(
  ISCHANGED( Customer_Survey__c, text = "Deployment " ),
  $User.Id = 'xyz01 , abc01 ')

Thank you 
Best Answer chosen by Mit Chandola
Amit SinghAmit Singh
Try below 
AND(
	ISCHANGED(Customer_Survey__c),
	TEXT(Customer_Survey__c) = "Deployment",
	Case(
		$User.Alias,
		'Alias1',1,
		'Alias2',1,
		0
	)=1
 )

Note: - Do not use User Id, Use username or Alias instead.
User-added image

All Answers

Amit SinghAmit Singh
Try below 
AND(
	ISCHANGED(Customer_Survey__c),
	TEXT(Customer_Survey__c) = "Deployment",
	Case(
		$User.Alias,
		'Alias1',1,
		'Alias2',1,
		0
	)=1
 )

Note: - Do not use User Id, Use username or Alias instead.
User-added image
This was selected as the best answer
Mit ChandolaMit Chandola
Amit, thanks for the quick reply. What about login as a user and then updating the field - will workflow fire? (This is what I want)
Amit SinghAmit Singh
You mean If any login user Edit the Record then survey must need to be sent?
Try below
AND(
	ISCHANGED(Customer_Survey__c),
	TEXT(Customer_Survey__c) = "Deployment"
)

 
Mit ChandolaMit Chandola
Nevermind it is taken care of.. I meant that if I login as other user (those with aliases in wrflows) will this still..works? 

It is working so I am good..thank you. 
Amit SinghAmit Singh
Cheers :)