Issue in Attachment Table SysID

Subashree KR
Tera Contributor

While submitting a catalog item, I'm working on restricting the attachment type. If the attachment type is not .xlsx, we shouldn't be able to submit the request. I created a script include to get the attachment filename. But it's not working. The reason behind is sys_id of the attachment doesn't match.

 

SubashreeKR_0-1742466300983.png

The attachment is stored in Sys Attachment table. But I'm not sure of the Table Sys Id. It's not the catalog item sys_id.

SubashreeKR_1-1742466428816.png

Can someone please help me to get the Table sys Id? So, I can use this 'Table sys_id' to get the Attachment record using Glide Record.

 

1 ACCEPTED SOLUTION

@Subashree KR 

you will have to use DOM manipulation etc to get the file names which I won't recommend.

I believe I have answered your question.

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

View solution in original post

7 REPLIES 7

Shivalika
Mega Sage

Hello @Subashree KR 

 

The "table sys id" is the sys id of the record in which attachment is stored. 

 

For eg. If it's stored in request item table record then it will be record's sys_id exactly and not catalog item.

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOwNeEISQCY

Subashree KR
Tera Contributor

Hello @Shivalika,

I'm trying to get the 'Table sys id' of the attachment I uploaded in the portal before submitting the request.

 

 

Hello @Subashree KR 

 

It's not that complicated actually. Since you are submitting the request, you should already be having a flow designer or something at place. 

 

In there request_item -> sys id - this sould be enough. Otherwise, you can dotwalk to request_item.sys_id if you are using workflow. 

 

Kindly mark my answer as helpful and accept solution if it helped you in anyway. This will help me be recognized for the efforts and also move this questions from unsolved to solved bucket. 

 

Regards,

 

Shivalika 

 

My LinkedIn - https://www.linkedin.com/in/shivalika-gupta-540346194

 

My youtube - https://youtube.com/playlist?list=PLsHuNzTdkE5Cn4PyS7HdV0Vg8JsfdgQlA&si=0WynLcOw

NeEISQCY

Ankur Bawiskar
Tera Patron
Tera Patron

@Subashree KR 

Why not use Attachment variable and only allow xlsx file?

You can achieve this requirement by populating variable attribute of attachment variable type as "allowed_extensions=xlsx".

AnkurBawiskar_0-1742471052150.png

 

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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