I have a computed field that is referencing a picklist, but the computed field is not working as it should!
Example:
Field = TIME_OF_DAY
Picklist: Morning, Afternoon, Night
Script:
(CASE
WHEN (TIME_OF_DAY = 'morning’) THEN 'one'
WHEN (TIME_OF_DAY = 'night')THEN 'two'
ELSE 'three'
END)
Solved! Go to Solution.
Solved by jpiggee. Go to Solution.
Solution:
Computed fields reference picklist by the position of the picklist option, not the value of the choice shown
For your example the “Morning, Afternoon, Night” the position is based on the last item being equal to 1
Example:
Morning = 3
Afternoon =2
Night =1
Script to use:
(CASE
WHEN (TIME_OF_DAY = 3) THEN 'one'
WHEN (TIME_OF_DAY = 1)THEN 'two'
ELSE 'three'
END)