Question about upload the photo to user table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
6 hours ago
Hi all,
I want to write a scripted api to upload the photo to user table. Here is my code but failed. Please help to correct the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
It is base64encoded data and running in global. I try to use
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
I also try this code in backgound and got the same issue. Sorry, It not allowed to post the Binary.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
since you in global scope write() method only accepts the actual content and it will work for text, csv files which are plain files.
try this link where I shared solution to attach file via scripted rest api then enhance it based on your requirement. once the image is copied to record, simply query sys_attachment with this user sysId and update the table name as 'ZZ_YYsys_user'
Scripted Rest API to update incident with attachment
Also share your JSON request body, how it looks
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
try this link where I shared solution to attach file via scripted rest api then enhance it based on your requirement. once the image is copied to record, simply query sys_attachment with this user sysId and update the table name as 'ZZ_YYsys_user'
Scripted Rest API to update incident with attachment
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader