- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 12:17 PM
Hi All,
We currently have a new inbound action that is creating incidents with employee details such as name, location, action date, etc. passed into the 'Description' field within the incident (see below). We've created a flow designer to extract the location into our 'Location' field, but I'm looking for any recommendations on how we could best extract the name and action date into the incident fields? Has anyone ever used a flow designer to extract something like this before? Or would a business rule work best?
Thanks in advance!
Example of Description body:
Employee Details
--------------------------------------------------
Employee Name................: John Smith
When to Action:
Date.........................: 04/11/2023
--------------------------------------------------
Office Details
--------------------------------------------------
Office Location..............: California
Solved! Go to Solution.
- Labels:
-
Incident Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 11:39 AM - edited 04-12-2023 11:45 AM
Here's a quick example of a script you can add directly to the Inbound Action to get the name from the email. On the target field, I used "name" as the example, so insert the relevant field there.
var extractName = email.body_text;
var getName = [];
getName = extractName.toString().split(": "); // split just before the name
var splVal = getName[1].split("\n"); // split at carrage return after name
current.name.setDisplayValue(splVal[0]); // value between the two splits
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 11:18 AM
Thanks Tony, this is helpful. Is this meant to be a business rule or through flow designer? Much appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 03:02 PM
This would be configured as is for a BR, but the basic syntax is the bsame and you would just have to map to flow input\output variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-12-2023 11:39 AM - edited 04-12-2023 11:45 AM
Here's a quick example of a script you can add directly to the Inbound Action to get the name from the email. On the target field, I used "name" as the example, so insert the relevant field there.
var extractName = email.body_text;
var getName = [];
getName = extractName.toString().split(": "); // split just before the name
var splVal = getName[1].split("\n"); // split at carrage return after name
current.name.setDisplayValue(splVal[0]); // value between the two splits
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-17-2023 12:54 PM
Thanks Ian, I appreciate it. The challenge here unfortunately is that there's multiple colons throughout the template.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2023 04:55 AM
If you are wanting additional values extracted that are after the first colon, just keep creating new "splits" and numbering them appropriately: 0 for what is in front of the split point and 1 for what is after the split point.
And just because I used the ":" as the split point, you could swap it for "Name...............: " to make it more unique.