Reply
Regular Contributor
David D
Posts: 21

How to compare two picklist field values?

I want to write a formula that evaluates the current value of a picklist field with the previous value.

 

I feel like it should be written:

 

MyField__c = PRIORVALUE(MyField__c)

where MyField is my picklist field...but I somehow have to use the ISPICKVALUE() function and cannot see how to implement this.

 

Anyone run into this before?


 

Super Contributor
Stevemo
Posts: 3,210

Re: How to compare two picklist field values?

Hi Dave,

 

I've done some PRIORVALUE formulas on Picklist fields, you might want to try hacking this one.  It basically locks the Picklist field once a user selects "A" form the list, otherwise it lets them edit it.

 

AND( ISCHANGED(Picklist_1__c ), ISPICKVAL(PRIORVALUE(Picklist_1__c ), "A"), NOT(ISPICKVAL( Picklist_1__c , "A")) )

 

 

 

 

 

 

 

 

"If you're in a band and you think that you're good, you probably suck. If you're in a band and you think that you suck, you probably do." - Bob Pollard
Regular Contributor
TigerPower
Posts: 51

Re: How to compare two picklist field values?

Hello Stevemo,

just wanted to let you know that ISCHANGED(Picklist) was something that I learned to use today. I was googling a possible solution for my formula, and found out this topic.

 

Living and learning.:smileyhappy:

 

Trusted Contributor
fifedog
Posts: 323

Re: How to compare two picklist field values?

Just my two cents on this: if you're using this to trigger a workflow be sure you select the evaluation critera to be everytime the record is edited. If you don't you can't use the ischanged function.
Fifedog
Adv Admin 301 and Dev 401 Certified