- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-02-2023 11:40 PM
Hi Experts,
Requipment- ServiceNow will receive below email from xyz system.
?Employee Name (employee ID 100) has been terminated within xyz. Please remove all associated system access for this employee. Effective date is 15/10/2023 11:59:00 PM?
Once received an email we need submit a catalog item.
Question- How can I get Employee Name and effective date from email so that I can use them while submiting a catalog item?
Thanks in advance,
NS
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 12:01 AM
Hi,
Looks like you need to extract data from the email using string functions.
Assuming you are receiving the email , you can write an inbound action and in that using the email objects in your case it can be "email.body_text" , this will return you the email body text as plain text and then you can search your string from the email.
For employee name you can use substring function with the starting position as "0" and ending position to be the position where your bracket starts.
For Effective date you can use the indexOf function to look for effective date text and then use substring to extract date as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 04:36 AM - edited ‎10-03-2023 04:36 AM
Okay got it, how can I get date with same format?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 04:46 AM
Assuming date mentioned is always after the text "Effective date is <Date> PM/AM" and that is the last text in that case you can simply extract the string in reverse order to do that you can use slice() function.
Please mark the appropriate response as correct answer and helpful to help others
