- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2023 11:29 PM - edited ‎12-26-2023 11:30 PM
Hi Experts,
I have a requirement to copy date and time provided in email body and update a hardware asset table depretiation start date field.
I have created a inbound email action to parse email body but struck at trimming date and time from recieved email body.
Can you please help me with the coding pls.
Sent mail will be like below.
from above mail i need to copy date and time and update a date time type field.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2023 01:15 AM
Thank you...
Fixed it using below code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-26-2023 11:43 PM
@ROS4349
Try this
var str = "abccc2023-01-01 12:33:33dfdfdf";
str2 = str.match(/[0-9][0-9][0-9][0-9]\-[0-1][0-9]\-[0-3][0-9]\s[0-2][0-9]\:[0-6][0-9]\:[0-6][0-9]/)[0];
gs.info(str2)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2023 12:46 AM
Thank you newhand.
Seems it is working but can you pls help me in fixing below error
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2023 12:56 AM
Below are the lines
var gr = new GlideRecord("sys_email");
gr.addQuery("sys_id","7417d26a1b5f7d50582add7cbc4bcb21");
gr.query();
if(gr.next())
{
var str = gr.body;
str2 = str.match(/[0-9][0-9][0-9][0-9]\-[0-1][0-9]\-[0-3][0-9]\s[0-2][0-9]\:[0-6][0-9]\:[0-6][0-9]/)[0];
gs.info(str2)
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2023 01:15 AM
Thank you...
Fixed it using below code