Select to view content in your preferred language

Arcade expression error in Watch Center Velocity Analytic

150
2
Jump to solution
03-27-2025 10:16 AM
Labels (1)
Bryan_Wade
Frequent Contributor

I am working on adding a River Gauge layer to the Watch Center Solution. I have my feed completed and am working on mapping the fields. I am using the Hurricane feed and hurricane fields to help me with the arcade expressions.

For the alert type field I am using this arcade: 

When(
  $feature.status == 'action', 'Action Stage',
  $feature.status == 'minor', 'Minor Flood Stage',
  $feature.status == 'moderate', 'Moderate Flood Stage',
  $feature.status == 'major', 'Major Flood Stage')
 
This mimics the alerttype field used with the hurricane feed:

 

When(

  $feature["STORMTYPE"] == 'TD', 'Tropical Depression',

  $feature["STORMTYPE"] == 'TS', 'Tropical Storm',

  $feature["STORMTYPE"] == 'HU', 'Hurricane',

  $feature["STORMTYPE"] == 'DB', 'Disturbance',

  $feature["STORMTYPE"] == 'STD', 'Subtropical Depression',

  $feature["STORMTYPE"] == 'SS', 'Subtropical System',

  $feature["STORMTYPE"] == 'STS', 'Subtropical System',

  $feature["STORMTYPE"] == 'WV', 'Tropical Wave',

  $feature["STORMTYPE"] == 'EX', 'Extratropical Storm',

  'Typhoon')

 I keep getting this error when I test the arcade expression - Test execution error: Compilation error - Line : 1, 0: Call with wrong number of parameters. Verify test data.
 
I get this error on the velocity side -
 Bryan_Wade_0-1743095718362.png

 

 I would appreciate any thoughts or assistance as I try to figure out
0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

The first When statement is missing the DefaultValue

When(
  $feature.status == 'action', 'Action Stage',
  $feature.status == 'minor', 'Minor Flood Stage',
  $feature.status == 'moderate', 'Moderate Flood Stage',
  $feature.status == 'major', 'Major Flood Stage',
  'N/A')

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

The first When statement is missing the DefaultValue

When(
  $feature.status == 'action', 'Action Stage',
  $feature.status == 'minor', 'Minor Flood Stage',
  $feature.status == 'moderate', 'Moderate Flood Stage',
  $feature.status == 'major', 'Major Flood Stage',
  'N/A')
Bryan_Wade
Frequent Contributor

Thanks for the help! That did the trick. I'm new to using arcade and really appreciate the assistance

0 Kudos