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

Pre-Generated Table Sys ID before Submit of Record Producer Catalog form

subhadeep1618
Tera Guru

I have a record producer catalog form linked to change_request table.

I have uploaded a file in the "add attachments" of the form (in portal).

Even before I click on submit, I can see that a record has been saved in sys_attachment table where: table_name = change_request table_sys_id = a unique sys id

My question is:

How did ServiceNow know this table_sys_id ?

And, how I can read this table_sys_id within my client-side or server-side script -- (important) Before Submit ?


Please mark this post as a solution and also as helpful, if this resolves your issue or query.

Thanks,
Subhadeep Ghosh.
1 REPLY 1

Ankur Bawiskar
Tera Patron

@subhadeep1618 

if you are on portal then within the OOTB widget I think there is some line which generates the sysId and that comes in table_sys_id in sys_attachment

-> _generatedItemGUID

Widget: SC Catalog Item (search in that widget)

55.png

you can verify this using this onLoad catalog client script on your record producer

function onLoad() {

    var sysId = this.angular.element("#sc_cat_item").scope().data._generatedItemGUID;
    alert(sysId);

}

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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