AnsweredAssumed Answered

How to use multiple 'Replace' Arcade functions?

Question asked by joseph.faliti on Nov 1, 2018
Latest reply on Nov 2, 2018 by joseph.faliti

Hi,

 

I have an Arcade labeling expression that is using the Replace function.  It works fine, but I have found that there are certain instances of the text that I don't want to replace.

 

If I add an additional Replace function, only the last one is honored.  How can I resolve this issue?

 

What I have is like this:

Replace($feature.NAME + " Grades " + $feature.LO_GRD + "-" + $feature.HI_GRD, '0', 'K')

It works, but if a zero (0) is in the name field, it also is replaced with a 'K'.

I tried to add an additional statement to replace the new string that is wrong.

Like this:

Replace($feature.NAME + " Grades " + $feature.LO_GRD + "-" + $feature.HI_GRD, '0', 'K')

Replace($feature.NAME + " Grades " + $feature.LO_GRD + "-" + $feature.HI_GRD, '1K', '10')

But that is not working.

 

Any information you are willing to share would be much appreciated!

 

Thanks,

 

Joe

 

arcade expression

Outcomes