AnsweredAssumed Answered

Convert JavaScript Label to ARCADE

Question asked by jbrockwe on Sep 6, 2019
Latest reply on Sep 10, 2019 by xander_bakker



I have a JavaScript label expression that I am having trouble converting to ARCADE. The label expression is addresses for New York City Buildings. Since some buildings have multiple addresses the ability to minimize text is essential.


In the label field are parenthesis and since ARCADE uses parenthesis i can't figure out how to represent them as text.



Here is the label expression in JavaScript:            
function FindLabel (  [FIELDNAMEl]   )
  return [FIELDNAME].replace(/::/g, "\n").replace(/ *\([^)]*\) */g, "");

JavaScript Version

In ARCADE I currently have the label expression looking like this:

Replace($feature.FIELDNAME, '/::/g/ *\([^)]*\) */g', " " )

Arcade Current

Parenthesis need to be removed from the label as well, which should remove the street name, for example, (W 34TH ST).


All types of characters should be replaced with nothing. I want to minimize code as well.



Thanks in Advance.Xander Bakker Jake Skinner