find table of current record

tyffanie_rbr
Tera Contributor

Hello,

How do I know which is the current object's table (or current record) on ServiceNow ?

 

thanks in advance

1 ACCEPTED SOLUTION

Manmohan K
Tera Sage

Hi @tyffanie_rbr 

 

You can find out by executing below line

current.getTableName();

 

View solution in original post

3 REPLIES 3

Manmohan K
Tera Sage

Hi @tyffanie_rbr 

 

You can find out by executing below line

current.getTableName();

 

Thank you very much for your answer!!!

Amit Gujarathi
Giga Sage
Giga Sage

HI @tyffanie_rbr ,
I trust you are doing great.
getCurrent().getTableName() method to retrieve the table name of the current record. Here's an example code snippet that demonstrates this:

 

var currentTable = gs.getCurrent().getTableName();
gs.info("Current table: " + currentTable);

 


Was this answer helpful?


Please consider marking it correct or helpful.


Your feedback helps us improve!


Thank you!


Regards,


Amit Gujrathi