Update Image to Table using Record Producer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 08:23 AM
Hi all, I’m having trouble with a Record Producer in ServiceNow. I'm trying to update an existing record in the table A with both a string field and a image field. However, the string gets updated but the the image is not updating in the existing record. A new record is created with both the string and image being created.
Here’s what I’m trying to do:
Prevent a new record from being created by using setAbortAction(current).
Update the existing record with the string and image fields from the Record Producer
this is the function in script include
this is the record producer script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 09:07 PM
If you are using "image" type field you need to understand few things before updating the image via script:
When you create it for the first time via producer that image will never be deleted until you deletes which means if you update it a new image will be inserted but old image will stays in the same record.
So, think and write the logic, lmk if you need help to building this.
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 11:21 PM
Hi @Murthy Ch, the image variable will be originally empty. User will upload the the image through record producer and the image field will only be updated by then.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-15-2025 09:41 PM
the 2nd variable is of type "Attachment"?
Share screenshots of your variable config
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
04-15-2025 11:38 PM
yes the 2nd variable in the record producer is type Attachment. In the table, the 2nd variable will be updated as Image type.