ServiceNow replaceAll doesn't work in scoped app
ServiceNow replaceAll doesn't work in scoped app apparently but fine in global scope
instead for scoped app use .replace(<string>/g)
All things ServiceNow... take a look at my channel: https://www.youtube.com/@cloudminus89
ServiceNow replaceAll doesn't work in scoped app apparently but fine in global scope
instead for scoped app use .replace(<string>/g)
String.prototype.replaceAll() was apparently added to JavaScript in ES2021, so it wouldn’t have been supported at all in ServiceNow prior to the Tokyo release. I do see it on the list of supported language features in the docs, but you would need to be in a scoped app (Tokyo or later) where you’ve explicitly enabled the ES2021 features.
ReplyDelete