- 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-02-2023 11:42 PM - edited ‎10-02-2023 11:43 PM
Hi @NS16,
Could you post the (html) body of the email?
And do you want to use a flow or inbound action to do the processing?
Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.
- 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:16 AM - edited ‎10-03-2023 04:17 AM
Hi @Anubhav24 ,
thanks for quick response , I tried your solution, with the substring function I am getting Employee Name for that I need to add start and end char position, but now my question char start and end position will be different each time, how to tackle that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2023 04:30 AM - edited ‎10-03-2023 04:33 AM
For extracting Employee Name you can start from the position 0 and end at the position which is before your first bracket. Ex:
<your string>.substring(0, <your string>.indexOf('(')); --- This will work assuming if your Employee name is always the first string
Please mark the appropriate response as correct answer and helpful to help others
