- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 09:58 AM
Hi,
I have custom multiple fields of type file attachment. How can I load attachments thru REST API to the custom file attachment fields?
Where to find how this table name created for this custom fields "zz_yydmn_demand" ? Thanks,
Ashraf
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 06:13 AM
Hi,
what I was able to achieve is below:
1) Use Attachment API to create file -> it would create an attachment record in sys_attachment table
POST: Upload an attachment from a binary request
Gave table name as ZZ_YYtable_name; in your case it would be ZZ_YYdmn_demand
Gave the table_sys_id -> record sys_id
file name -> you want
Request body -> attachment data
2) now you will have to populate the attachment sys_id from step 1 in the field which is of type File Attachment on that record; once you update that field with that sys_id it should start showing
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 10:02 AM
Use below to create attachments via REST API
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-05-2020 10:03 AM
Hi,
Using Attachment API it is possible to load attachment
Go through this below doc
https://developer.servicenow.com/dev.do#!/reference/api/orlando/rest/c_AttachmentAPI
Thanks,
Kunal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 03:06 AM
Hi Ashraf,
So are you saying you are having a field of type "File Attachment"
but you are unable to add file to that
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2020 05:43 AM
Thanks Ankur for your response. Since, I have two custom file attachment fields, how do I know which file is being attached to which one thru script? As, I don't see name of the fields.
For custom fields, it has table name "zz_yydmn_demand". I didn't find this table info when I looked at custom field dictionary. Where can I find this table name?