Reply
Contributor
coreyg
Posts: 4

need help replicating a picklist value

Use Case:

I want to be able to easily run reports on our leads to see what the first lead source was and what the last lead source was. To do this I setup a field call Primary Lead Source and created a workflow that executes on Lead creation, the following script:

(IF( ISPICKVAL(LeadSource, "Contact Form") , "Contact Form",
IF( ISPICKVAL(LeadSource , "Employee Referral") , "Employee Referral",
IF( ISPICKVAL(LeadSource, "enewsletter") , "enewsletter",
IF( ISPICKVAL(LeadSource , "External Referral") , "External Referral",
IF( ISPICKVAL(LeadSource, "inbound call") , "inbound call",
IF( ISPICKVAL(LeadSource, "Landing Pages") , "Landing Pages",
IF( ISPICKVAL(LeadSource, "Trade Show") , "Trade Show",
IF( ISPICKVAL(LeadSource, "Existing Customer") , "Existing Customer",
IF( ISPICKVAL(LeadSource, "Support Quote") , "Support Quote",
null
))))))))))

I simplified the above script so that there aren't as many options. So the issue is that I don't want to have to update this script everytime we add a lead source. Can anyone think of a way of having it automatically check the picklist for the value and if it exists to print that value in the field?

Any help would be greatly appreciated