how do you show/ hide a formatter on form

saidarao
Tera Contributor

how do you show/ hide a formatter   on form

4 REPLIES 4

sachin_namjoshi
Kilo Patron
Kilo Patron

UI formatter in not a field so setVisible or setDisplay method will not work.


You will have to try out DOM level manupulation.



You can use the $ selector to element ID and hide it using DOM methods when particular condition is met.



How to hide/show an UI action on field changes



Regards,


Sachin


Ankur Bawiskar
Tera Patron
Tera Patron

Hi,



What is the requirement to show/hide the formatter.



If it is view based then you can have different views and in the form layout add/remove the ui formatter.



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I have Created one attachment   by using UI formatter.   i have to hide/show the attachment button based drop down value.


Inactive_Us1289
Mega Contributor

Hi,



You can try displaying the formatter under a particular section on the form and using client script you can hide/display the section.



Thanks,


Tamoghna