Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How to attach file from a local machine to a particular record.

Vishal_Jaiswal
Mega Guru

My local machine folder(Documents) has a list of attachments with different types like PDF, JPG, etc.

The attachment file name starts with incidentNumber_fileName. For example: INC123456_users.pdf.

Requirement: I have to attach these attachments to their corresponding incident. How to do this?

14 REPLIES 14

Rafael Batistot
Kilo Patron

Hi @Vishal_Jaiswal 

 

The bast way is drag and drop or may you follow those instructions 

 

https://www.servicenow.com/docs/bundle/zurich-platform-user-interface/page/use/using-forms/task/t_Ad...

If you found this response helpful, please mark it as Helpful. If it fully answered your question, consider marking it as Correct. Doing so helps other users find accurate and useful information more easily.

I have to do this through a script because there are large no of attachments.

@Vishal_Jaiswal 

Via script only work if the attachment is in ServiceNow, in the table sys_attachment

 

If your files are out serviceNow maybe  necessary to use external languages that integrate via ServiceNow.

I’m not safe that work but I can found some tutorials that to use powerShell

in ServiceNow, the best approach to do it is via clip 

 

IMG_0225.jpeg

 

https://youtu.be/sjqutAvjXhY?si=I-wofqBrsD73xj7V

If you found this response helpful, please mark it as Helpful. If it fully answered your question, consider marking it as Correct. Doing so helps other users find accurate and useful information more easily.
In this episode, we'll dive into a practical tutorial on how to upload and attach files to ServiceNow records using PowerShell. Whether you're looking to automate routine tasks or enhance your ServiceNow workflows, this quick guide will help you get there. ✳ 𝐓𝐀𝐊𝐄𝐀𝐖𝐀𝐘𝐒 ✳ Using REST API Ex...

Ankur Bawiskar
Tera Patron
Tera Patron

@Vishal_Jaiswal 

what's the business requirement?

Users can always browse files from local machine and add to record using paper-clip icon.

why to have script for this?

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