<?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 Service Portal: Client Side Data to Server Side in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112106#M769032</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a custom field using HTML and now i want to get the value being input in that field towards the server side in Service Portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HTML Part:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;lt;img ng-src="{{::c.data.logo}}" /&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;lt;a href="?id={{::c.data.homepage}}"&amp;gt;Click here to go home&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div&amp;gt;Enter your Last name:&lt;/P&gt;&lt;P&gt;&amp;lt;input type="text" ng-model="c.data.lastname" id="LN" ng-change="c.displayNew()"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;h2&amp;gt;{{ c.data.messageNew }}&amp;lt;/h2&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Client Side Part:-&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;function() {&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;var c = this;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;c.displayNew = function(){&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;c.data.messageNew = (c.data.lastname) ? 'Hello ' + c.data.lastname + '!' : '';&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;}&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;c.display();&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;c.server.update();&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Server Side part:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(function() {&lt;/P&gt;&lt;P&gt; &amp;nbsp; /* populate the 'data' object */&lt;/P&gt;&lt;P&gt; &amp;nbsp; /* e.g., data.table = $sp.getValue('table'); */&lt;/P&gt;&lt;P&gt; &amp;nbsp; console.log("Server Side"+input);&lt;/P&gt;&lt;P&gt; &amp;nbsp; var portalGr = $sp.getPortalRecord();&lt;/P&gt;&lt;P&gt; &amp;nbsp; console.log("Server Side"+portalGr);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;})();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how to get the "Last Name" which is being input to the server side for further validations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dhruv Chandan&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2017 09:33:35 GMT</pubDate>
    <dc:creator>Dhruv Chandan</dc:creator>
    <dc:date>2017-06-26T09:33:35Z</dc:date>
    <item>
      <title>Service Portal: Client Side Data to Server Side</title>
      <link>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112106#M769032</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've created a custom field using HTML and now i want to get the value being input in that field towards the server side in Service Portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;HTML Part:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;lt;img ng-src="{{::c.data.logo}}" /&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;lt;a href="?id={{::c.data.homepage}}"&amp;gt;Click here to go home&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;div&amp;gt;Enter your Last name:&lt;/P&gt;&lt;P&gt;&amp;lt;input type="text" ng-model="c.data.lastname" id="LN" ng-change="c.displayNew()"/&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;h2&amp;gt;{{ c.data.messageNew }}&amp;lt;/h2&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Client Side Part:-&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;function() {&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;var c = this;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;c.displayNew = function(){&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;c.data.messageNew = (c.data.lastname) ? 'Hello ' + c.data.lastname + '!' : '';&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;}&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;c.display();&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;c.server.update();&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Server Side part:-&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(function() {&lt;/P&gt;&lt;P&gt; &amp;nbsp; /* populate the 'data' object */&lt;/P&gt;&lt;P&gt; &amp;nbsp; /* e.g., data.table = $sp.getValue('table'); */&lt;/P&gt;&lt;P&gt; &amp;nbsp; console.log("Server Side"+input);&lt;/P&gt;&lt;P&gt; &amp;nbsp; var portalGr = $sp.getPortalRecord();&lt;/P&gt;&lt;P&gt; &amp;nbsp; console.log("Server Side"+portalGr);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;})();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any idea how to get the "Last Name" which is being input to the server side for further validations.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help is appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Dhruv Chandan&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 09:33:35 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112106#M769032</guid>
      <dc:creator>Dhruv Chandan</dc:creator>
      <dc:date>2017-06-26T09:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Service Portal: Client Side Data to Server Side</title>
      <link>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112107#M769033</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You are quite close. On the server side you get the input via "input.data.lastname".&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Also see this for inspiration:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="https://serviceportal.io/communicating-between-the-client-script-and-the-server-script-of-a-widget/" title="https://serviceportal.io/communicating-between-the-client-script-and-the-server-script-of-a-widget/"&gt;https://serviceportal.io/communicating-between-the-client-script-and-the-server-script-of-a-widget/&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Jun 2017 10:04:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112107#M769033</guid>
      <dc:creator>larstange</dc:creator>
      <dc:date>2017-06-26T10:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Service Portal: Client Side Data to Server Side</title>
      <link>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112108#M769034</link>
      <description>&lt;P&gt;Hi Lars,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I tried "console.log("Server Side"+input.data.lastname);"&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;but it showing up as undefined in the logs even with the entries filled in.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Dhruv Chandan&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Jun 2017 10:45:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112108#M769034</guid>
      <dc:creator>Dhruv Chandan</dc:creator>
      <dc:date>2017-06-26T10:45:20Z</dc:date>
    </item>
    <item>
      <title>Re: Service Portal: Client Side Data to Server Side</title>
      <link>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112109#M769035</link>
      <description>&lt;P&gt;console.log is a client-side only javascript command&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;input.data. is server-side only&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You can't mix the two.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You can do a gs.log though, then look through your servicenow logs to find what &amp;nbsp; you're trying to see.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Jun 2017 11:27:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112109#M769035</guid>
      <dc:creator>xiaix</dc:creator>
      <dc:date>2017-06-26T11:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Service Portal: Client Side Data to Server Side</title>
      <link>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112110#M769036</link>
      <description>&lt;P&gt;Hi David,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.log("Server Side"+input.data.lastname,"dc31"); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Used the above statement in the sever side code and the system logs is still showing it as undefined.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Dhruv Chandan&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Jun 2017 12:16:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112110#M769036</guid>
      <dc:creator>Dhruv Chandan</dc:creator>
      <dc:date>2017-06-26T12:16:44Z</dc:date>
    </item>
    <item>
      <title>Re: Service Portal: Client Side Data to Server Side</title>
      <link>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112111#M769037</link>
      <description>&lt;P&gt;Hi Dhruv,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You're close here. When using server.update() the data object is represented by the input object, so you would typically do something like this on the server:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;if (input) {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; console.log("Server Side: " + input.lastname);&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;You don't need to write input.data, and service portal is unique in that it lets you use console.log() on both the client and server side script areas.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Jun 2017 13:19:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112111#M769037</guid>
      <dc:creator>Brad Tilton</dc:creator>
      <dc:date>2017-06-26T13:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: Service Portal: Client Side Data to Server Side</title>
      <link>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112112#M769038</link>
      <description>&lt;P&gt;Hi Brad,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks man it worked ! &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" data-renderedposition="50_160_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;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Dhruv Chandan&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Jun 2017 18:03:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/service-portal-client-side-data-to-server-side/m-p/2112112#M769038</guid>
      <dc:creator>Dhruv Chandan</dc:creator>
      <dc:date>2017-06-26T18:03:00Z</dc:date>
    </item>
  </channel>
</rss>

