<?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 Populate fields from email from inbound email action in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524538#M181464</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to populate fields from email if it has same name but it is under different section. I am attaching my email. In the email it contains Problem Number 1 , Problem Number 2 and Problem Number 3 under each it has issue and details. So i want to populate Problem Number 1 Issue into Issue 1(In service now form field) and Details into Details 1(Form field) same like this for Problem Number 2 and Problem Number 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="email format.JPG"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/177364i1B827EE49202C3DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="email format.JPG" alt="email format.JPG" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Fri, 15 Sep 2017 00:34:24 GMT</pubDate>
    <dc:creator>daggupati</dc:creator>
    <dc:date>2017-09-15T00:34:24Z</dc:date>
    <item>
      <title>Populate fields from email from inbound email action</title>
      <link>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524538#M181464</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to populate fields from email if it has same name but it is under different section. I am attaching my email. In the email it contains Problem Number 1 , Problem Number 2 and Problem Number 3 under each it has issue and details. So i want to populate Problem Number 1 Issue into Issue 1(In service now form field) and Details into Details 1(Form field) same like this for Problem Number 2 and Problem Number 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="email format.JPG"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/177364i1B827EE49202C3DE/image-size/large?v=v2&amp;amp;px=999" role="button" title="email format.JPG" alt="email format.JPG" /&gt;&lt;/span&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2017 00:34:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524538#M181464</guid>
      <dc:creator>daggupati</dc:creator>
      <dc:date>2017-09-15T00:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Populate fields from email from inbound email action</title>
      <link>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524539#M181465</link>
      <description>&lt;P class="shortdesc" style="margin-bottom: 10px; font-size: 16px; color: #343d47; font-family: Source_Sans_Pro, Gotham, Helvetica, Arial, sans-serif;"&gt;Refer: &lt;A href="https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/administer/notification/reference/r_SetFieldValsFromTheEmailBody.html" title="https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/administer/notification/reference/r_SetFieldValsFromTheEmailBody.html"&gt;https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/administer/notification/reference/r_SetFieldValsFrom…&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;&lt;P class="shortdesc" style="margin-bottom: 10px; font-size: 16px; color: #343d47; font-family: Source_Sans_Pro, Gotham, Helvetica, Arial, sans-serif;"&gt;Values in an inbound email can set field values in a task record.&lt;/P&gt;&lt;BR /&gt;&lt;P class="p" style="margin-bottom: 10px;"&gt;Any name:value pair in an inbound email body gets parsed into a variable/value pair in the inbound email script. The name:value pair must be on its own line. Note that most email clients limit the number of characters allowed per line and may truncate excessively long name:value pairs.&lt;/P&gt;&lt;BR /&gt;&lt;P class="p" style="margin-bottom: 10px;"&gt;To populate a reference field, use &lt;CODE class="ph codeph" style="padding: 2px 4px; font-family: monospace, serif; color: inherit; background: #f5f8fa;"&gt;setDisplayValue()&lt;/CODE&gt; instead. See &lt;A class="xref" href="https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/administer/notification/reference/r_RedirEmailDifferentAssignGrp.html#r_RedirEmailDifferentAssignGrp" style="color: #e51b24;" title="You can have other mailboxes forward email to the instance's POP3 account."&gt;Redirecting Emails&lt;/A&gt; for an example of using &lt;CODE class="ph codeph" style="padding: 2px 4px; font-family: monospace, serif; color: inherit; background: #f5f8fa;"&gt;setDisplayValue()&lt;/CODE&gt; in an inbound email action.&lt;/P&gt;&lt;BR /&gt;&lt;P class="p"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;DIV class="note note_note" style="margin: 10px 0 0;"&gt;&lt;SPAN class="note__title" style="font-weight: bold;"&gt;Note:&lt;/SPAN&gt; The action always generates a lowercase variable name. Also, this functionality does not work on reference fields.&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;/DIV&gt;&lt;P&gt;For example, if an email body contains this line:&lt;/P&gt;&lt;BR /&gt;&lt;PRE class="prettyprint prettyprinted" style="padding: 2px; margin-bottom: 10px; font-family: monospace, serif; color: #333333; background-color: #f5f5f5;"&gt;&lt;SPAN class="typ" style="color: #660066;"&gt;Foo&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;:&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;bar&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;The inbound email script creates the variable &lt;CODE class="ph codeph" style="padding: 2px 4px; font-family: monospace, serif; color: inherit; background: #f5f8fa;"&gt;email.body.foo&lt;/CODE&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; with the value of &lt;CODE class="ph codeph" style="padding: 2px 4px; font-family: monospace, serif; color: inherit; background: #f5f8fa;"&gt;bar&lt;/CODE&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;. You can use these variables to create conditions such as:&lt;/P&gt;&lt;BR /&gt;&lt;PRE class="prettyprint prettyprinted" style="padding: 2px; margin-bottom: 10px; font-family: monospace, serif; color: #333333; background-color: #f5f5f5;"&gt;&lt;SPAN class="kwd" style="color: #000088;"&gt;if&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;email&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;body&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;foo&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;!=&lt;/SPAN&gt;&lt;SPAN class="kwd" style="color: #000088;"&gt;undefined&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;){&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt; current&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.[&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;field&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;]=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;email&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;body&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #000000;"&gt;foo&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #666600;"&gt;;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;In this example, the script sets the value of &lt;CODE class="ph codeph" style="padding: 2px 4px; font-family: monospace, serif; color: inherit; background: #f5f8fa;"&gt;[field]&lt;/CODE&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; to the value &lt;CODE class="ph codeph" style="padding: 2px 4px; font-family: monospace, serif; color: inherit; background: #f5f8fa;"&gt;bar&lt;/CODE&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;.&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;~Hit like/Helpful/answered, if it helped to your issue.&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Aravinda&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Sep 2017 00:38:53 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524539#M181465</guid>
      <dc:creator>Aravinda YS</dc:creator>
      <dc:date>2017-09-15T00:38:53Z</dc:date>
    </item>
    <item>
      <title>Re: Populate fields from email from inbound email action</title>
      <link>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524540#M181466</link>
      <description>&lt;P&gt;Hi aravind,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks for the reply. Populating field is not a problem, but in my case i have same name fields repeating multiple times under different sections &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;like Problem Number 1 in that Issue and Details and in the Problem Number 2 again it has Issue and Details.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Sep 2017 00:58:10 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524540#M181466</guid>
      <dc:creator>daggupati</dc:creator>
      <dc:date>2017-09-15T00:58:10Z</dc:date>
    </item>
    <item>
      <title>Re: Populate fields from email from inbound email action</title>
      <link>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524541#M181467</link>
      <description>&lt;P&gt;Please check if this helps.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15054449191231195 jive_text_macro" data-renderedposition="47.986114501953125_7.986111640930176_1039_140" jivemacro_uid="_15054449191231195" modifiedtitle="true"&gt;&lt;P&gt;var arraystr = [];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;arraystr = email.body_text.trim().split('Problem Number');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;for(var i = 1; arraystr.length &amp;gt;= i; i++){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var prob = [];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;prob = arraystr[i].split('\n');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.log('details_' + i + ':' + prob[3].split(':')[1]);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.log('issue_' + i + ':' + prob[2].split(':')[1]);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Sep 2017 03:13:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524541#M181467</guid>
      <dc:creator>Shishir Srivast</dc:creator>
      <dc:date>2017-09-15T03:13:41Z</dc:date>
    </item>
    <item>
      <title>Re: Populate fields from email from inbound email action</title>
      <link>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524542#M181468</link>
      <description>&lt;P&gt;Hi Shishir,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Instead of log messages, How can i pass the values into the form(Issue1,Issue2,Issue3 and Details1,Details2,Details3).&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Sep 2017 04:28:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524542#M181468</guid>
      <dc:creator>daggupati</dc:creator>
      <dc:date>2017-09-15T04:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: Populate fields from email from inbound email action</title>
      <link>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524543#M181469</link>
      <description>&lt;P&gt;Somehow array is not working for me, but was able to get in this way, see if this helps.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_15054507933341937 jive_text_macro" data-renderedposition="47.986114501953125_7.986111640930176_1191_436" jivemacro_uid="_15054507933341937" modifiedtitle="true"&gt;&lt;P&gt;var arraystr = [];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;arraystr = email.body_text.trim().split('Problem Number');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;for(var i = 1; arraystr.length &amp;gt;= i; i++){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var prob = [];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;prob = arraystr[i].split('\n');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;switch(i) {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;case 1:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var details1 = prob[3].split(':')[1];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var issue1 = prob[2].split(':')[1];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.log('details1' + details1);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.log('issue1' + issue1);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;break;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;case 2:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var details2 = prob[3].split(':')[1];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var issue2 = prob[2].split(':')[1];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.log('details2' + details2);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.log('issue2' + issue2);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;break;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;case 3:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var details3 = prob[3].split(':')[1];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var issue3 = prob[2].split(':')[1];&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.log('details3' + details3);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.log('issue3' + issue3);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;break;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.log(details1 + ':' + details2 + ':' + details3 + ':' + issue1 + ':' + issue2 + ':' + issue3);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Sep 2017 04:48:19 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/1524543#M181469</guid>
      <dc:creator>Shishir Srivast</dc:creator>
      <dc:date>2017-09-15T04:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Populate fields from email from inbound email action</title>
      <link>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/2823178#M1082604</link>
      <description>&lt;P&gt;When I am not typing email.body it is not taking the refrence.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Feb 2024 05:41:50 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populate-fields-from-email-from-inbound-email-action/m-p/2823178#M1082604</guid>
      <dc:creator>pratiksha5</dc:creator>
      <dc:date>2024-02-12T05:41:50Z</dc:date>
    </item>
  </channel>
</rss>

