Arcade Trim leaving field qualifiers

1088
2
Jump to solution
07-19-2019 10:07 AM
AaronCraig2
Occasional Contributor

Hi, I am performing the following arcade expression in the Data webpage under the feature service in ArcGIS online:

Trim(Text(Split($feature["FULL_ADDRESS"], $feature["HOUSE_NO_LABEL"], 1, 0)))

As you can see from the image, the resulting string is left with the field qualifiers. Are my methodologies causing the issue or is this an arcade bug?


Cheers,

Aaron

0 Kudos
1 Solution

Accepted Solutions
KenBuja
MVP Esteemed Contributor

It's actually returning an array of one item, consisting of the string. To get that item, you have to use this syntax

var array = Split($feature["FULL_ADDRESS"], $feature["HOUSE_NO_LABEL"], 1, 0);
return Trim(Text(array[0]));‍‍

or 

Trim(Text(Split($feature["FULL_ADDRESS"], $feature["HOUSE_NO_LABEL"], 1, 0)[0]));‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

View solution in original post

2 Replies
KenBuja
MVP Esteemed Contributor

It's actually returning an array of one item, consisting of the string. To get that item, you have to use this syntax

var array = Split($feature["FULL_ADDRESS"], $feature["HOUSE_NO_LABEL"], 1, 0);
return Trim(Text(array[0]));‍‍

or 

Trim(Text(Split($feature["FULL_ADDRESS"], $feature["HOUSE_NO_LABEL"], 1, 0)[0]));‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
AaronCraig2
Occasional Contributor

Thanks Ken!

0 Kudos