Needed to add a field to a published layer and calculate values based on existing field. Tried using "When" function but the expression has remained in "Calculating" mode for over 30 minutes (only 174 records). Can someone tell me if my syntax is off?
var target = $feature["dept_name"]
var source = $feature["user_business_unit"]
target = When(
source == 'ACOFD',
'Fire',
source == 'ALCSO',
'Sheriff',
source == 'ASESR',
'Assessor',
source == 'AUDTR',
'Auditor',
source == 'BOARD',
'BOS',
source == 'CAOFF',
'CAO',
source == 'CMDEV',
'CDA',
source == 'COLIB',
'Library',
source == 'CONSL',
'Counsel',
source == 'DAOFF',
'DA',
source == 'GENSA',
'GSA',
source == 'HDSVS',
'Health Department',
source == 'HRSVC',
'Human Resources',
source == 'ITDPT',
'ITD',
source == 'OFFCS',
'Child Services',
source == 'PBWKS',
'PWA',
source == 'PDOFF',
'Public Defender',
source == 'PROBT',
'Probation',
source == 'ROVTR',
'ROV',
source == 'SOCSA',
'Social Services',
source == 'TRETC',
'Tax Collector',
source == 'ZONE7',
'Zone 7', source)