<?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 Re: inbound email action Scoped Application in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133930#M790856</link>
    <description>&lt;P&gt;The new methods (gs.debug/info/warn/error) are documented in the link provided earlier, complete with a video. &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="8_709.65625_16_16" src="https://www.servicenow.com/8.0.4.21bdc7e/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 26 Apr 2017 14:00:29 GMT</pubDate>
    <dc:creator>Chuck Tomasi</dc:creator>
    <dc:date>2017-04-26T14:00:29Z</dc:date>
    <item>
      <title>inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133919#M790845</link>
      <description>&lt;P&gt;I have created an inbound email action which is in scoped application.&lt;/P&gt;&lt;P&gt;here the problem is If I glide record user table to check and set the user as "guest". it doesnot create the record. it jus skips the inbound email action.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;current.short_description = email.subject; // Set email subject&lt;/P&gt;&lt;P&gt;current.description = email.body_text; // set email body&lt;/P&gt;&lt;P&gt;var eto = email.to.toLowerCase().toString();&lt;/P&gt;&lt;P&gt;var sid='';&lt;/P&gt;&lt;P&gt;var rec = new GlideRecord('sys_user');&lt;/P&gt;&lt;P&gt;rec.addQuery('email',email.from);&lt;/P&gt;&lt;P&gt;rec.query();&lt;/P&gt;&lt;P&gt;if(rec.next()){&lt;/P&gt;&lt;P&gt; &amp;nbsp; gs.log("inside");&lt;/P&gt;&lt;P&gt; &amp;nbsp; sid = rec.sys_id.toString();&lt;/P&gt;&lt;P&gt; &amp;nbsp; gs.log("user is"+sid);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt; &amp;nbsp; if(sid=='')&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; gs.log("else");&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; sid = gs.getUser().getUserByID('guest').getID();&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; gs.log("user is"+sid);&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;P&gt; current.u_caller = sid;&lt;/P&gt;&lt;P&gt; &amp;nbsp; current.insert();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: If i use same code for global application. it does work . I am not sure why it is not working for scoped application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one sort this out?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2017 12:06:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133919#M790845</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2017-04-26T12:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133920#M790846</link>
      <description>&lt;P&gt;I suspect your gs.getUser() may be having issues in the scoped app. Try this in place of the line sid = gs.getUser()...&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var user = new GlideRecord('sys_user');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;user.get('user_name', guest);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;sid = user.getValue('sys_id');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Also, note that gs.log() is not supported in scoped apps. Use gs.info(), gs.debug(), gs.warn(), and gs.error().&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2017 12:11:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133920#M790846</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2017-04-26T12:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133921#M790847</link>
      <description>&lt;P&gt;Hi Harish,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;what is your &lt;SPAN style="color: #2f3e14; font-family: SourceSansPro, 'Helvetica Neue', Arial; font-size: 13px; text-align: right;"&gt;Target table (to which table, your are mapping this Inbound action).&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;And try to send emails from exiting servicenow users mapped email ID.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2017 12:13:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133921#M790847</guid>
      <dc:creator>Adiseshu Borra</dc:creator>
      <dc:date>2017-04-26T12:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133922#M790848</link>
      <description>&lt;P&gt;Still no luck. It doesnot create record even when the user is present in the database&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Updated Code:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;// Implement email action here&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.short_description = email.subject; // Set email subject&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.description = email.body_text; // set email body&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var eto = email.to.toLowerCase().toString();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; gs.log("Inbound run1"+eto);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var sid='';&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var rec = new GlideRecord('sys_user');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;rec.addQuery('email',email.from);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;rec.query();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;if(rec.next()){&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; gs.log("inside");&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; sid = rec.sys_id.toString();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; gs.log("user is"+sid);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; if(sid=='')&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; gs.log("else");&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; var user = new GlideRecord('sys_user');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;user.get('user_name', guest);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;sid = user.getValue('sys_id');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; gs.log("user is"+sid);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; }&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; current.requestor = sid;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; current.insert();&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2017 12:18:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133922#M790848</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2017-04-26T12:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133923#M790849</link>
      <description>&lt;P&gt;Hi Adiiseshu , target table is "x_8690_case_manage_case_management"&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2017 12:20:04 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133923#M790849</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2017-04-26T12:20:04Z</dc:date>
    </item>
    <item>
      <title>Re: inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133924#M790850</link>
      <description>&lt;P&gt;Hi &lt;A title="ctomasi" __default_attr="2218" __jive_macro_name="user" class="jive-link-profile-small jive_macro jive_macro_user" data-id="2218" data-objecttype="3" data-orig-content="ctomasi" data-renderedposition="10.40000057220459_25.100000381469727_67_16" data-type="person" href="https://www.servicenow.com/community?id=community_user_profile&amp;amp;user=7ae05a61db981fc09c9ffb651f9619a2"&gt;ctomasi&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Earlier I was using the below code&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.short_description = email.subject; // Set email subject&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.description = email.body_text; // set email body&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.u_requestor = email.from; // set email caller&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.state = 1; // set state to new&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.contact_type = "email"; // set channel to email&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.priority = 4; // set priority to low&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.company = gs.getUser().getCompanyID();// Set company&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;current.insert();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;The above code is working fine. Now If any user sends the email to servicenow who are not present in the database I need to set the caller field as "guest". Could you let me know how to do this as I am facing issues&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2017 12:26:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133924#M790850</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2017-04-26T12:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133925#M790851</link>
      <description>&lt;P&gt;As noted earlier, gs.log() is not available in scoped applications. Please use the scoped debugging methods in scoped scripts.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="http://wiki.servicenow.com/index.php?title=Scoped_Script_Logging#gsc.tab=0" title="http://wiki.servicenow.com/index.php?title=Scoped_Script_Logging#gsc.tab=0"&gt;Scoped Script Logging - ServiceNow Wiki&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2017 12:29:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133925#M790851</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2017-04-26T12:29:23Z</dc:date>
    </item>
    <item>
      <title>Re: inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133926#M790852</link>
      <description>&lt;P&gt;Hi Harish,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;i hope, &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; if user is not available in servicenow database, servicenow will consider user as guest( out of the box).&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2017 12:31:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133926#M790852</guid>
      <dc:creator>Adiseshu Borra</dc:creator>
      <dc:date>2017-04-26T12:31:34Z</dc:date>
    </item>
    <item>
      <title>Re: inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133927#M790853</link>
      <description>&lt;P&gt;Thanks Chuck. gs.log was the issue.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2017 13:46:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133927#M790853</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2017-04-26T13:46:26Z</dc:date>
    </item>
    <item>
      <title>Re: inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133928#M790854</link>
      <description>&lt;P&gt;You are welcome. I'm glad you got it resolved. It took me a while to convert, but now i use the new methods in global or scoped apps.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2017 13:50:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133928#M790854</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2017-04-26T13:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133929#M790855</link>
      <description>&lt;P&gt;Is there any blog I can find about your new method chuck?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2017 13:58:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133929#M790855</guid>
      <dc:creator>Harish KM</dc:creator>
      <dc:date>2017-04-26T13:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: inbound email action Scoped Application</title>
      <link>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133930#M790856</link>
      <description>&lt;P&gt;The new methods (gs.debug/info/warn/error) are documented in the link provided earlier, complete with a video. &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="8_709.65625_16_16" src="https://www.servicenow.com/8.0.4.21bdc7e/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Apr 2017 14:00:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inbound-email-action-scoped-application/m-p/2133930#M790856</guid>
      <dc:creator>Chuck Tomasi</dc:creator>
      <dc:date>2017-04-26T14:00:29Z</dc:date>
    </item>
  </channel>
</rss>

