Hi- I wrote a simple arcade script to replace text in a field for the pop-up display and have run into something unusual.
The script will replace the abbreviated name for impairment type with the full name for each hydro feature in the layer.
var impParam = $feature["IMP_PARAM"];
impParam = Replace(impParam, 'FishesBio', 'Fishes bioassessments');
impParam = Replace(impParam, 'Hg-F', 'Mercury in fish tissue');
impParam = Replace(impParam, 'E.coli', 'Escherichia coli');
impParam = Replace(impParam, 'InvertBio', 'Aquatic macroinvertebrate bioassessments');
impParam = Replace(impParam, 'TSS', 'Total Suspended solids');
impParam = Replace(impParam, 'T', 'Turbidity');
return impParam;
Some features have several impairments listed, example:
It works great except that the Replace function will not replace 1 character strings, such as the 'T' for 'Turbidity', AGOL doesn't like it at all and will stall out forcing me to reload the page. Any ideas why I cannot replace a 1 char string or any suggestions for improving the script?
Thanks much!
Kate