Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

convert to uppercase on business rule

zschneider
Kilo Expert

I have a request to convert certain fields to all uppercase. It looks like the toUppercase() function does not work on a business rule, and it's necessary to use a BR for this since a lot of the field data will come in through bulk imports.

Does anyone have any suggestions on how to convert a field value to all uppercase in a business rule?

Thanks!

5 REPLIES 5

CapaJC
ServiceNow Employee
ServiceNow Employee

Hmm, this worked fine for me in a "before update" Business Rule:



current.short_description.toUpperCase();


Are you sure your Business Rule is running?


I tested it out on description, not short_description. I wonder if it's an issue with that field type. Thanks for the feedback.


I just tested and confirmed that it works on Description.

Before business rule - on insert or update
Condition: current.description != current.description.toUpperCase()
Script:
current.description = current.description.toUpperCase();


Also see attached screenshot.


CapaJC
ServiceNow Employee
ServiceNow Employee

Ah wait, you typed "toUppercase()". Is that what you used? The correct method is "toUpperCase()".