function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Paula Jarvis 4Paula Jarvis 4 

Create Workflow on Standard Field to Update Custom Field

I would like to creat a Workflow that updates a Custom picklist Field (MRR Territory) based on the Standard State/Province Field. I will have all 50 states to accommodate for in the formula and three territories (East, Central, West). Here is how I started the Rule:
IF(ISPICKVAL(State/Province, "AL"), 
IF(ISPICKVAL(State/Province, "SC"),
(MRR_Territory, (Central))

I keep getting an error message.
Best Answer chosen by Paula Jarvis 4
AnjithKumarAnjithKumar
Paula, What is the Field Type of  State, if it is text value then use following code
 
IF(OR(State=="Alabama",State=="Texas"),
TEXT(MRR_Territory_Marketo__c), 'Central' )

 

All Answers

Andy BoettcherAndy Boettcher
The error message you're probably getting is that the formula has too many characters, right?  You may be better off either changing that picklist field to a formula and using a VLOOKUP approach in that formula field or perhaps even Visual Workflow to tree out all of those decisions.  Barring those options there is always an APEX trigger to run the logic.
Paula Jarvis 4Paula Jarvis 4
I adjusted the code to accommodate for the TEXT field, not a picklist field. Here is the adjusted code but I get this error - Error: Syntax error. Missing ')'

IF(TEXT(State) = "AL", 
IF(TEXT(State) = "SC",
(MRR_Territory_Marketo__c, (Central))
AnjithKumarAnjithKumar
Hi Paula,

Here is the updated code
IF(TEXT(State) = "AL", IF(TEXT(State) = "SC", MRR_Territory_Marketo__c, 'Central' ))


 
Paula Jarvis 4Paula Jarvis 4
Anjith, now I get this error - Error: Incorrect parameter type for function 'TEXT()'. Expected Number, Date, DateTime, Picklist, received Text

I've updated the fomula to and now I get this error - Error: Syntax error. Extra IF

IF(INCLUDES(State) = "Alabama",
MRR_Territory_Marketo__c, 'Central' )
IF(INCLUDES(State) = "Texas",
MRR_Territory_Marketo__c, 'Central' ))
 
AnjithKumarAnjithKumar
Paula, I have updated the formula 
IF(OR(INCLUDES(State) = "Alabama",INCLUDES(State) = "Texas"),
MRR_Territory_Marketo__c, 'Central' )

Let me know if it works
AnjithKumarAnjithKumar
If "State" is picklist then you have use following code
 
IF(OR(ISPICKVAL(State, "Alabama"),ISPICKVAL(State, "Texas")),
MRR_Territory_Marketo__c, 'Central' )

 
Paula Jarvis 4Paula Jarvis 4
Anjith, I am still getting error message when I try your latest solutin. The State field is NOT a picklist however the "Mrr Teritory" Field is a picklist.Here is error message from the latest code - Error: Incorrect number of parameters for function 'INCLUDES()'. Expected 2, received 1
 
AnjithKumarAnjithKumar
Paula, What is the Field Type of  State, if it is text value then use following code
 
IF(OR(State=="Alabama",State=="Texas"),
TEXT(MRR_Territory_Marketo__c), 'Central' )

 
This was selected as the best answer