how to get table name using catalog client script in portal page

ramprasadk
Tera Contributor

I am using g_form.getTableName() to get table name in catalog client script in portal. But it all always giving me null. Please let me know different ways to get the table name using catalog client script in portal. 

4 REPLIES 4

Samaksh Wani
Giga Sage
Giga Sage

Hello @ramprasadk 

 

You can use this in Server Side Script :-

 

data.title = $sp.getDisplayValue("sc_cat_item");

 

In HTML :-

 

<div>
    <h1>sp_instance.title: {{::data.title}}</h1>
</div>

 

Plz Mark my Solution as Accept and Give me thumbs up, if you find it Helpful.

 

Regards,

Samaksh

I have open RITM by using "id=form&table=sc_req_item&sys_id=9b5505c1975721107d9e3e66f053af1b&view=sp" by this link. In Catalog client script g_form.gettablename() using.

Sagar Pagar
Tera Patron

Hi @ramprasadk,

 

Is it possible to create Client scripts on Catalog task table and specific to your catalog item?

where you will use the g_form.getTableName();

 

If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers.
Thanks,
Sagar Pagar

The world works with ServiceNow

I have open RITM by using "id=form&table=sc_req_item&sys_id=9b5505c1975721107d9e3e66f053af1b&view=sp" by this link. In Catalog client script g_form.gettablename() has using in if condition.