How to fetch replied containt from email (Inbound email action)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2025 02:10 AM - edited ‎03-21-2025 02:13 AM
Hello All,
Our requirement is to update the replied content from an email into the worknotes section of a ticket. I created an inbound action for email replies, designing the script based on my email format (worked properly). However, when other users tried it, it didn't work correctly and ended up updating extra content.
I searched the ServiceNow community but couldn't find any threads with the same requirement. Most solutions involve using a fixed format or extracting a specific number of lines, but our goal is to capture everything the user types in their reply.
I attempted a workaround by requiring a full stop at the end of the message, which worked, but our client does not want any additional formatting constraints in emails. Does anyone have any suggestions? Is there a method to reliably extract only the user’s response without adding specific markers?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2025 04:35 AM
You can use regex to identify and extract the user's response by looking for common email reply patterns. For example, you can try to capture text before the quoted reply section (e.g., "On [date], [user] wrote:").
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-21-2025 04:50 AM
is the reply email containing different formats/content when other users reply?
If yes then you need to train the users so that your script handles particular case and doesn't break when users send format other than agreed one.
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
‎03-21-2025 07:20 AM
Thanks for your response,
Users don't follow a consistent pattern. Some have signatures, while others don't. I tried creating regex based on my signature and email content, but that doesn't work for other team members either. So, the issue is that no one has a similar format. Is there an out-of-the-box solution in ServiceNow or any method to extract only the reply content?