- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 04:47 AM
Should we need to use current.update() or current.insert in inbound email action script for creating new incident.
I am using the script below. Is this correct, or should I make any modifications to comply with best practices?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 04:56 AM
best to check OOB inbound action on incident table
you should use current.insert() to insert a new record
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
01-13-2025 04:56 AM
best to check OOB inbound action on incident table
you should use current.insert() to insert a new record
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
01-13-2025 04:57 AM
current.update() will be used if you are using the email type as Reply and some user replies to email which he/she has received from instance
This will update the record associated with that inbound email
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
01-13-2025 05:03 AM
As suggested by @Ankur Bawiskar , I would use the OOTB examples as a guide. Note the OOTB also wraps the insert with some additional validation that the user should be able to create the Incident
if(current.canCreate())
current.insert();
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2025 05:13 AM
Hi @Kishor O ,
In the case of creating a new Incident , you should be using current.insert() to create the new record. If the script is trying to update an existing Incident, then you would use current.update().
also add the below validator
if (current.canWrite())
current.update();
if(current.canCreate())
current.insert();
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------