how do you hide a formatter

randrews
Tera Guru

I have a Formatter for a UI macro for a knowledge solution...

i would like to make it so only people with a given role can see the formatter.


Is there an easy way to remove the formatter from the form if someone doesn't have a specified role?

3 REPLIES 3

CapaJC
ServiceNow Employee
ServiceNow Employee

There currently isn't a g_form method to hide a formatter. Best you could do would be to either modify the formatter and put its contents in an "if" block testing for a role, or use an onLoad client script to find the contents of the formatter with something like document.getElementById("[the id of the HTML element]").style.display = "none".

The latter method would require that the content of the formatter is such that it is contained in a element with an ID, and would require some knowledge of HTML manipulation via JavaScript.

Is this a custom formatter, or an out-of-box one?


SRJ
Tera Contributor

HI ,



I want to display only text on the Approval form when the Approving for could be RITM , I created custom formatters.But i want to hide when Approvinf for is CHG.


Please help me how we can hide formatters