+ Start a Discussion
Ti Saunders 8Ti Saunders 8 

Workflow Rule Formula -Prior Value - Value for Picklist

We have a field called Lead_Rating which is a picklist with options: A+, A, B, C, or D. I am trying to write a workflow rule that will trigger when the Lead_Rating field is changed FROM D or C, to A+, A, or B.

In addition to the above, the rule should only trigger if another field called "Lead_Status" (also a picklist) is equal to one of these 3 values: New, Returning, or Qualified. 

I'm trying the below formula, but am getting: 
Error: Function PRIORVALUE may not be used in this type of formula

OR(text(PRIORVALUE( Lead_Status__c )='D'), text(PRIORVALUE(Lead_Status__c )='C')) 
,OR(Lead_Status__c='A', Lead_Status__c='A+', Lead_Status__c='B'))
Dhanya NDhanya N
Hi Saunders,

You might have used evaluation criteria as "created, and any time it's edited to subsequently meet criteria". 
Change it to "created, and every time it's edited" (2nd option). 

Ti Saunders 8Ti Saunders 8
I've changed the criteria and am getting more errors.

My new formula is:

OR(text(PRIORVALUE(Lead_Rating__c),'D'), text(PRIORVALUE(Lead_Rating__c),'C')) 
,OR(Lead_Rating__c='A+', Lead_Rating__c='A', Lead_Rating__c='B'), 
Lead_Status__c = New, Returning, Pursuing, 'Sales Qualified' 

One of the errors is: Error: Incorrect number of parameters for function 'text()'. Expected 1, received 2
Dhanya NDhanya N
The formula you are using is wrong in syntax. Follow Picklist Formulas (https://trailhead.salesforce.com/en/content/learn/modules/advanced_formulas/picklist_formulas) for more details.

Give a try with below formula:
, OR(ISPICKVAL(Lead_Rating__c, "A+"), ISPICKVAL(Lead_Rating__c, "A"), ISPICKVAL(Lead_Rating__c, "B")), 
OR(ISPICKVAL(Lead_Status__c, "New"), ISPICKVAL(Lead_Status__c, "Returning"), 
ISPICKVAL(Lead_Status__c, "Qualified"))