We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

Field present on form

Lohith
Giga Expert

Hi Team,

How to know whether a field exists on form or not

For ex: I want to know whether field A present on form or not, if present then go ahead and perform validations. if field not exists on form then

don't perform any validations.

Appreciate your inputs

Thanks,

Lohith

1 ACCEPTED SOLUTION

Shishir Srivast
Mega Sage

you can check using g_form.hasField('<your field name>') if field is present on the form or not.


View solution in original post

6 REPLIES 6

snehabinani26
Tera Guru

Hi lohith,



For validation go ahead and use Client script. If the field is present in the form, action will be performed otherwise not.


Karthik Reddy T
Kilo Sage

Hello Lohit,



Right Click on form .



Configure> Form layout then it will displays what are the available fields in that form.



find_real_file.png




find_real_file.png


Karthik Reddy T.
ServiceNow Commnunity MVP -2018 class.

Hi @Karthik Reddy

 

thanks for sharing, very helpful.

Shishir Srivast
Mega Sage

you can check using g_form.hasField('<your field name>') if field is present on the form or not.