<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Extracting Name from Incident 'Description' in Incident Management forum</title>
    <link>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2531625#M4352</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of Description body:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Employee Details&lt;/P&gt;&lt;P&gt;--------------------------------------------------&lt;/P&gt;&lt;P&gt;Employee Name................: John Smith&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When to Action:&lt;/P&gt;&lt;P&gt;Date.........................: 04/11/2023&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------------&lt;/P&gt;&lt;P&gt;Office Details&lt;/P&gt;&lt;P&gt;--------------------------------------------------&lt;/P&gt;&lt;P&gt;Office Location..............: California&lt;/P&gt;</description>
    <pubDate>Tue, 11 Apr 2023 19:17:23 GMT</pubDate>
    <dc:creator>JW22</dc:creator>
    <dc:date>2023-04-11T19:17:23Z</dc:date>
    <item>
      <title>Extracting Name from Incident 'Description'</title>
      <link>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2531625#M4352</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example of Description body:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Employee Details&lt;/P&gt;&lt;P&gt;--------------------------------------------------&lt;/P&gt;&lt;P&gt;Employee Name................: John Smith&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When to Action:&lt;/P&gt;&lt;P&gt;Date.........................: 04/11/2023&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------------&lt;/P&gt;&lt;P&gt;Office Details&lt;/P&gt;&lt;P&gt;--------------------------------------------------&lt;/P&gt;&lt;P&gt;Office Location..............: California&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 19:17:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2531625#M4352</guid>
      <dc:creator>JW22</dc:creator>
      <dc:date>2023-04-11T19:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Name from Incident 'Description'</title>
      <link>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2531658#M4353</link>
      <description>&lt;P&gt;1) Extract the employee name:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add a new "Transform Data" action to your flow.&lt;/LI&gt;&lt;LI&gt;Select the "Description" field as the input data.&lt;/LI&gt;&lt;LI&gt;Use a regular expression to extract the employee name from the description field. For example, the regular expression Employee Name\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.: (.+) would match the employee name in the sample data you provided.&lt;/LI&gt;&lt;LI&gt;Map the output of the regular expression to the "Short Description" field of the incident record.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;2) Extract the action date:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add a new "Transform Data" action to your flow.&lt;/LI&gt;&lt;LI&gt;Select the "Description" field as the input data.&lt;/LI&gt;&lt;LI&gt;Use a regular expression to extract the action date from the description field. For example, the regular expression Date\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.\\.: (.+) would match the action date in the sample data you provided.&lt;/LI&gt;&lt;LI&gt;Map the output of the regular expression to a custom date field on the incident record.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 20:30:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2531658#M4353</guid>
      <dc:creator>DUGGI</dc:creator>
      <dc:date>2023-04-11T20:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Name from Incident 'Description'</title>
      <link>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2531669#M4354</link>
      <description>&lt;P&gt;Hi, if you were able to access the source and tidy up\remove the unnecessary '................ 'formatting it would be a lot cleaner. As an alternative to the regex solution, you will be able to use substring() and indexOf() to extract your values and I think this makes your intentions clearer to future users\developers.&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var test = current.short_description;
var indexStart = test.indexOf('Employee Name');
var indexSize =  test.indexOf(':', indexStart);
var indexEnd = test.indexOf('\n', indexStart);
var myString = test.substring(indexStart + (indexSize - indexStart), indexEnd).trim();
gs.info(myString);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 20:54:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2531669#M4354</guid>
      <dc:creator>Tony Chatfield1</dc:creator>
      <dc:date>2023-04-11T20:54:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Name from Incident 'Description'</title>
      <link>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2531674#M4355</link>
      <description>&lt;P&gt;Hi Duggi, thanks for the quick reply. How would I set the regular expression to look for the employee name?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 21:03:57 GMT</pubDate>
      <guid>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2531674#M4355</guid>
      <dc:creator>JW22</dc:creator>
      <dc:date>2023-04-11T21:03:57Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Name from Incident 'Description'</title>
      <link>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2531694#M4356</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DUGGI_0-1681249244048.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/253836iEA52688F1DF8A1B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DUGGI_0-1681249244048.png" alt="DUGGI_0-1681249244048.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you need to create a flow variable and pass it to the short description while creating an incident&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DUGGI_1-1681249328568.png" style="width: 400px;"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/253837i2DD09B2923A8325D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DUGGI_1-1681249328568.png" alt="DUGGI_1-1681249328568.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 21:42:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2531694#M4356</guid>
      <dc:creator>DUGGI</dc:creator>
      <dc:date>2023-04-11T21:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Name from Incident 'Description'</title>
      <link>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2532920#M4376</link>
      <description>&lt;P&gt;Thanks Tony, this is helpful. Is this meant to be a business rule or through flow designer? Much appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 18:18:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2532920#M4376</guid>
      <dc:creator>JW22</dc:creator>
      <dc:date>2023-04-12T18:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Name from Incident 'Description'</title>
      <link>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2532933#M4377</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;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&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 18:45:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2532933#M4377</guid>
      <dc:creator>Ian Mildon</dc:creator>
      <dc:date>2023-04-12T18:45:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Name from Incident 'Description'</title>
      <link>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2533053#M4378</link>
      <description>&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 22:02:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2533053#M4378</guid>
      <dc:creator>Tony Chatfield1</dc:creator>
      <dc:date>2023-04-12T22:02:56Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Name from Incident 'Description'</title>
      <link>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2536863#M4412</link>
      <description>&lt;P&gt;Thanks Ian, I appreciate it. The challenge here unfortunately is that there's multiple colons throughout the template.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 19:54:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2536863#M4412</guid>
      <dc:creator>JW22</dc:creator>
      <dc:date>2023-04-17T19:54:30Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting Name from Incident 'Description'</title>
      <link>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2538763#M4456</link>
      <description>&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And just because I used the ":" as the split point, you could swap it for "Name...............: " to make it more unique.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 11:55:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/incident-management-forum/extracting-name-from-incident-description/m-p/2538763#M4456</guid>
      <dc:creator>Ian Mildon</dc:creator>
      <dc:date>2023-04-19T11:55:59Z</dc:date>
    </item>
  </channel>
</rss>

