How do I make an image a default value in a field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 12:31 AM
Hi - I have a requirement to where we would like a screenshot/image of our priority matrix as a reference for our SD team in the incident form. Is there a way to add an image to a field and have it a default value whenever a new incident record is created?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-12-2023 12:39 AM
there is no direct way but here is a workaround explained by ServiceNow in KB article, follow it
How to set a default image on an image field (not knowledge)
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
09-14-2023 07:40 AM
@Ankur Bawiskar Thank you for the guidance...this actually attaches the image to the record. Is there a way to have the image set as default in a specific field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2023 07:54 AM
Do this
1) create a system property and attach the image to it, in the value field of that property add sys_id of the newly created system property
2) then use before insert BR on your table and use this script
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var sysId = GlideSysAttachment.copy("sys_property", gs.getProperty('propertyName'), "ZZ_YYincident", current.sys_id);
current.imageField = sysId;
})(current, previous);
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
09-14-2023 09:36 PM
Hope you are doing good.
Did my reply answer your question?
If my response helped please close the thread by marking appropriate response as correct so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader