The CreatorCon Call for Content is officially open! Get started here.

Find the table name of Table sys id in attachments - Before catalog item submission

Anish Reghu
Kilo Sage

Dear experts,

find_real_file.png

The Table sys id highlighted in the pic above, how do I find the table name of that sys_id?

It is not sc_cat_item nor is it, sc_cart_item.

This is the attachment entry created before submission of the catalog item.

 

Regards,

Anish

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Anish Reghu 

It seems you are adding file to some record producer or catalog item during submission

The sysId you are seeing is not any record of some table

It's a temporary GUID which ServiceNow generates and links it to sc_cart_item table during catalog form submission

More detailed discussion here

Is there a way to get the cart item id in portal

Regards
Ankur

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

View solution in original post

17 REPLIES 17

Yes Indeed, Its a brilliant feature.

Please Mark Correct/helpful, if applicable, Thanks!!
Regards
Sulabh Garg

Sohail Khilji
Kilo Patron

Hi Anish,

 

You can use the below script which will help you...

var gr = new GlideRecord('sys_db_object');
gr.addQuery('sys_id','YOURSYSID HERE'); 
gr.query();
while(gr.next())
   {
   gs.addInfoMessage(gr.name); //This will give you table name
}

 

Thanks,

Sohail Khilji

Kindly Mark Correct / Helpful if it address your concern...

 


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect

Hi Sohail,

 

Thanks, but this just scans the sys_id of the tables in ServiceNow.

What I need is - that input be any table record without specifying table name and system returns me the table name.

 

Regards,

Anish

Alicia Haag
Kilo Contributor

On this page, you’ll find a few of the scripts I’ve saved over the years, and maybe a few scripts submitted by our most clever and dashing readers. The scripts you’ll find here, are one-off blocks of code that solve one problem as efficiently as they can. You won’t find detailed deep-dive explanations here, like you would in my articles on the blog; just examples, prototypes, and quick fixes to common coding conundrums. You also won’t find any of the scripts that I’ve already written articles with detailed explanations on, such as the Journal Redactor.

 ReadyPay Online Login

Thanks for commenting. But, I don't find any hyperlinks in your comment.