How to differentiate between attachments uploaded via attachment icon and those uploaded via custom button

Johannes Mweli
Giga Guru

Hi ServiceNow Community Developers,

 I have the following requirement – I need to differentiate between attachments that I uploaded using the attachment icon (paper clip) at the top of the form and the ones I attached using a custom button that I wrote using a UI Macro. In the ones that I uploaded using the custom button I need to put a special flag on them so that I am able to report on them. I think this basically requires a change in the UI Macro that I wrote (please see attached screenshot) however I am not sure how to go about doing that.  Can you please advise if there is a way to accomplish this kind of functionality.

Thanks,

Johannes

1 ACCEPTED SOLUTION

Hi,

you can use field of type File attachment and no macro is required

when you add file from that field type the table name field on sys_attachment starts with ZZ_YYtableName

that you can use report on sys_attachment

find_real_file.png

Regards
Ankur

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

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

you cannot differentiate unless you have some custom field on sys_attachment table

I doubt you can achieve this

Regards
Ankur

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

Hi Ankur,

Thanks for your response.

If i add a custom field on the sys_attachment table will that help to achieve the functionality I am looking for.

Also I just noticed a field type called File attachment, I wonder if that can help somehow. I am busy trying it now.

Thanks,

Johannes

Hi,

you can use field of type File attachment and no macro is required

when you add file from that field type the table name field on sys_attachment starts with ZZ_YYtableName

that you can use report on sys_attachment

find_real_file.png

Regards
Ankur

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

Thanks Ankur,

Yes, by using field type of File Attachment I got the desired functionality I was looking for.