- 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-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-06-2020 06:22 AM
Got it. Thanks for all your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 09:07 AM
How do you create an attachment record at first if it's asking for a sys_id in the request? Which operation did you use? thank you