<?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 Interact with service portal widget in catalog item in ServiceNow AI Platform forum</title>
    <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159411#M115800</link>
    <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we are currently analyzing if we can replace our current service catalog (based on the standard ServiceNow interface and self-service module - no CMS) with the Service Portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a number of more advanced catalog items, where we use UI macro to display additional information to the user, that we are not able to achieve using the available variable types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As UI Macros are not available in Service Portal we need a replacement. Here I have discovered a new "widget" field the catalog varaible form, where you can point to a portal widget and get it displayed on the catalog item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But we need to be able to interact with the widget and affect what it is displaying based on the values selected in the variables on the catalog item.&lt;BR /&gt;Basically I want to write to the data in the widget's scope via a catalog client script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The normal way of accessing an angular scope from the outside is using the syntax &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14712506890046248 jive_text_macro" data-renderedposition="300.72442626953125_7.997159004211426_1192_15" jivemacro_uid="_14712506890046248" modifiedtitle="true"&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;&lt;SPAN class="kwd" style="color: #101094;"&gt;var&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; scope &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; angular&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;element&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;$&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #7d2727;"&gt;"#[element]"&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;)).&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;scope&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;();&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have created a clone of the Hello World 1 widget and modified it so the input field has an ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="_jivemacro_uid_14712509532986743 jive_macro_code jive_text_macro" data-renderedposition="378.90625_7.997159004211426_1192_77" jivemacro_uid="_14712509532986743"&gt;&lt;P&gt;&amp;lt;div&amp;gt;&lt;/P&gt;&lt;P&gt; Enter your name:&lt;/P&gt;&lt;P&gt; &amp;lt;input id="helloWorld" type="text" ng-model="c.data.sometext" ng-change="c.display()"/&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;lt;h1&amp;gt;{{ c.data.message }}&amp;lt;/h1&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Then I try to access the scope from an onChange script in the catalog item&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14712509619494988 jive_text_macro" data-renderedposition="497.99713134765625_7.997159004211426_1192_62" jivemacro_uid="_14712509619494988"&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; var scope = angular.element(document.getElementById('helloWorld')).scope();&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; scope.$apply(function(){&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scope.data.sometext = newValue;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i get an error in the console saying &lt;SPAN style="color: #e23d39;"&gt;(g_env) [SCRIPT:EXEC] Error while running Client Script "onChange_name": TypeError: Cannot read property 'element' of null&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it looks like the catalog client scripts does not have access to the loaded angular in any way. I have tried some different thinks to try and be able to access angular but no avail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anybody has an idea I would appreciate any pointers - if we don't solve this, then the portal is not an option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Lars&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A title="nathanfirth" __default_attr="6193" __jive_macro_name="user" class="jive-link-profile-small jive_macro jive_macro_user" data-id="6193" data-objecttype="3" data-orig-content="nathanfirth" data-renderedposition="771.6334838867188_7.997159004211426_85_15" data-type="person" href="https://www.servicenow.com/community?id=community_user_profile&amp;amp;user=a95e8ae5dbd41fc09c9ffb651f9619be"&gt;nathanfirth&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Aug 2016 08:49:29 GMT</pubDate>
    <dc:creator>larstange</dc:creator>
    <dc:date>2016-08-15T08:49:29Z</dc:date>
    <item>
      <title>Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159411#M115800</link>
      <description>&lt;P&gt;Hi all&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So we are currently analyzing if we can replace our current service catalog (based on the standard ServiceNow interface and self-service module - no CMS) with the Service Portal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a number of more advanced catalog items, where we use UI macro to display additional information to the user, that we are not able to achieve using the available variable types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As UI Macros are not available in Service Portal we need a replacement. Here I have discovered a new "widget" field the catalog varaible form, where you can point to a portal widget and get it displayed on the catalog item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But we need to be able to interact with the widget and affect what it is displaying based on the values selected in the variables on the catalog item.&lt;BR /&gt;Basically I want to write to the data in the widget's scope via a catalog client script.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The normal way of accessing an angular scope from the outside is using the syntax &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14712506890046248 jive_text_macro" data-renderedposition="300.72442626953125_7.997159004211426_1192_15" jivemacro_uid="_14712506890046248" modifiedtitle="true"&gt;&lt;CODE style="font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, sans-serif;"&gt;&lt;SPAN class="kwd" style="color: #101094;"&gt;var&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; scope &lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt; angular&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;element&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;$&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="str" style="color: #7d2727;"&gt;"#[element]"&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;)).&lt;/SPAN&gt;&lt;SPAN class="pln" style="color: #303336;"&gt;scope&lt;/SPAN&gt;&lt;SPAN class="pun" style="color: #303336;"&gt;();&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So I have created a clone of the Hello World 1 widget and modified it so the input field has an ID&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="_jivemacro_uid_14712509532986743 jive_macro_code jive_text_macro" data-renderedposition="378.90625_7.997159004211426_1192_77" jivemacro_uid="_14712509532986743"&gt;&lt;P&gt;&amp;lt;div&amp;gt;&lt;/P&gt;&lt;P&gt; Enter your name:&lt;/P&gt;&lt;P&gt; &amp;lt;input id="helloWorld" type="text" ng-model="c.data.sometext" ng-change="c.display()"/&amp;gt;&lt;/P&gt;&lt;P&gt; &amp;lt;h1&amp;gt;{{ c.data.message }}&amp;lt;/h1&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;/div&amp;gt;&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;Then I try to access the scope from an onChange script in the catalog item&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="javascript" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14712509619494988 jive_text_macro" data-renderedposition="497.99713134765625_7.997159004211426_1192_62" jivemacro_uid="_14712509619494988"&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; var scope = angular.element(document.getElementById('helloWorld')).scope();&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; scope.$apply(function(){&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; scope.data.sometext = newValue;&lt;/P&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i get an error in the console saying &lt;SPAN style="color: #e23d39;"&gt;(g_env) [SCRIPT:EXEC] Error while running Client Script "onChange_name": TypeError: Cannot read property 'element' of null&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So it looks like the catalog client scripts does not have access to the loaded angular in any way. I have tried some different thinks to try and be able to access angular but no avail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If anybody has an idea I would appreciate any pointers - if we don't solve this, then the portal is not an option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Lars&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A title="nathanfirth" __default_attr="6193" __jive_macro_name="user" class="jive-link-profile-small jive_macro jive_macro_user" data-id="6193" data-objecttype="3" data-orig-content="nathanfirth" data-renderedposition="771.6334838867188_7.997159004211426_85_15" data-type="person" href="https://www.servicenow.com/community?id=community_user_profile&amp;amp;user=a95e8ae5dbd41fc09c9ffb651f9619be"&gt;nathanfirth&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 08:49:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159411#M115800</guid>
      <dc:creator>larstange</dc:creator>
      <dc:date>2016-08-15T08:49:29Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159412#M115801</link>
      <description>&lt;P&gt;I found the solution my self.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;You can read and write to the catalog variables using $scope.page.g_form. and then any of the g_form function like setValue and getValue.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Then I use the angular $watch feature to define a function to watch for changes in the catalog variable and then update my data in the widget scope.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;It looks like this&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;HTML template&lt;/P&gt;&lt;BR /&gt;&lt;PRE __default_attr="xml" __jive_macro_name="code" class="jive_macro_code jive_text_macro _jivemacro_uid_14712608248974881" data-renderedposition="175.26988220214844_7.997159004211426_1192_62" jivemacro_uid="_14712608248974881"&gt;&lt;P&gt; &amp;nbsp; &amp;lt;div&amp;gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; Data from catalog variable:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;lt;h1&amp;gt;{{ c.data.message }}&amp;lt;/h1&amp;gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;lt;/div&amp;gt;&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;Client Script Controller&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_1471260935720815 jive_text_macro" data-renderedposition="278.90625_7.997159004211426_1192_175" jivemacro_uid="_1471260935720815"&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;function($scope) {&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var c = this;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Watch for changes in the name variable&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $scope.$watch(function () {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return $scope.page.g_form.getValue('name');&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }, function (value) {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Update local data object with data from variable&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c.data.message = value ? 'Content of name variable: ' + value : '';&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;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Result - the text in the widget is updated when you change focus away from the catalog variable&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/116273i4832D694485823B0/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Aug 2016 11:33:48 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159412#M115801</guid>
      <dc:creator>larstange</dc:creator>
      <dc:date>2016-08-15T11:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159413#M115802</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 am trying to use widget field with macro as a type but it is not rendering the widget itself.Can you tell me what I should do to make it available on catalog item.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Please help as it is bit urgent.Appreciate your help&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Warm regards,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Milap&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Aug 2016 06:15:05 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159413#M115802</guid>
      <dc:creator>milapshah15</dc:creator>
      <dc:date>2016-08-19T06:15:05Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159414#M115803</link>
      <description>&lt;P&gt;Hi Milap&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;The widget will only be visible if you open the catalog item through the Service Portal&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Aug 2016 06:22:25 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159414#M115803</guid>
      <dc:creator>larstange</dc:creator>
      <dc:date>2016-08-19T06:22:25Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159415#M115804</link>
      <description>&lt;P&gt;I would be careful with using $scope.$watch as you are hoping that angular can pick up on all the custom logic ServiceNow has for it's elements. Eg, reference fields won't work with this solution as they are complex HTML components.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;A better solution would be to use standard catalog scripts and fire standard JS events like &lt;STRONG&gt;CustomEvent.fire&lt;/STRONG&gt;('my.namespaced.event') and then your widgets listen via &lt;STRONG&gt;CustomEvent.observe&lt;/STRONG&gt;('my.namespaced.event', &amp;lt;function callback&amp;gt;).&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 02 Sep 2016 14:30:13 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159415#M115804</guid>
      <dc:creator>Daniel Pettet</dc:creator>
      <dc:date>2016-09-02T14:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159416#M115805</link>
      <description>&lt;P&gt;Hi Daniel&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Thanks for the tip - I can see some clear advantages by doing it that way - I will surely experiment with that method as well!&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;That said, it do seem to work quite well with a multi line string variable and just let the widget watch for changes.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;But in the case where you need more than one widget pr catalog item I believe that your method will be better&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 05 Sep 2016 05:40:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159416#M115805</guid>
      <dc:creator>larstange</dc:creator>
      <dc:date>2016-09-05T05:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159417#M115806</link>
      <description>&lt;P&gt;Good work Lars! &amp;nbsp; Works perfectly.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Oct 2016 22:13:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159417#M115806</guid>
      <dc:creator>scottl</dc:creator>
      <dc:date>2016-10-26T22:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159418#M115807</link>
      <description>&lt;P&gt;Reference fields do work, as it returns the sys_id of the referenced record.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 26 Oct 2016 22:15:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159418#M115807</guid>
      <dc:creator>scottl</dc:creator>
      <dc:date>2016-10-26T22:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159419#M115808</link>
      <description>&lt;P&gt;Another approach can be seen this post &lt;A href="http://serviceportal.io/embedding-widgets-in-service-catalog/" title="http://serviceportal.io/embedding-widgets-in-service-catalog/"&gt;Embedding widgets in Service Catalog - ServicePortal.io - Service Portal, CMS, and Custom Apps&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Nov 2016 12:20:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159419#M115808</guid>
      <dc:creator>larstange</dc:creator>
      <dc:date>2016-11-22T12:20:58Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159420#M115809</link>
      <description>&lt;P&gt;Hi Lars,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I tried accessing the variable name using &lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;$scope.page.g_form.getValue(&lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue; background-color: #f6f6f6;"&gt;'variable_name'&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;) in client controller.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;Here on change of variable, I'm populating the variable based on client script in another variable , but when I use alert(&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;$scope.page.g_form.getValue(&lt;/SPAN&gt;&lt;SPAN class="string" style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: blue; background-color: #f6f6f6;"&gt;'variable_name'&lt;/SPAN&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;));&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;I was getting error "Cannot read property 'getValue' of undefined".&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;Could you let me know if I'm missing something over here.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; font-family: Consolas, 'Courier New', Courier, mono, serif; color: #000000; background-color: #f6f6f6;"&gt;Bhavin&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Mar 2017 13:45:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159420#M115809</guid>
      <dc:creator>Bhavin Jain1</dc:creator>
      <dc:date>2017-03-08T13:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159421#M115810</link>
      <description>&lt;P&gt;Did you include ($scope) in your initialization of the client controller?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;function($scope) {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; /* widget controller */&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var c = this;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Mar 2017 14:06:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159421#M115810</guid>
      <dc:creator>larstange</dc:creator>
      <dc:date>2017-03-08T14:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159422#M115811</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;Yes I have included $scope.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Below is the code i was trying from the example you shared above.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;function ($scope, $http, spUtil, nowAttachmentHandler, $rootScope, $location,$window) {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; var c = this;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;$scope.$watch(function () {&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; alert($scope.page.g_form.getValue('hide'));&lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return $scope.page.hide.value; &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; }, function (value) { &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;// &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //Update local data object with data from variable &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; c.data.message = value ? 'Content of name variable: ' + value : ''; &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; alert(c.data.message);&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;}); &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;It threw error saying "&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;Cannot read property 'getValue' of undefined"&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: Consolas, 'Courier New', Courier, mono, serif; font-size: 12px; background-color: #f6f6f6;"&gt;Bhavin&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Mar 2017 17:10:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159422#M115811</guid>
      <dc:creator>Bhavin Jain1</dc:creator>
      <dc:date>2017-03-08T17:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159423#M115812</link>
      <description>&lt;P&gt;Where do you run the code - it will not work within in widget editor. The page.g_form part is only available when the widget is run via a macro variable in a cataog item&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 08 Mar 2017 17:50:59 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159423#M115812</guid>
      <dc:creator>larstange</dc:creator>
      <dc:date>2017-03-08T17:50:59Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159424#M115813</link>
      <description>&lt;P&gt;Im using as single line text field,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Ideally should work for all kind of variables, if i want to retrieve the value.&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;&lt;P&gt;Bhavin&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 09 Mar 2017 11:56:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159424#M115813</guid>
      <dc:creator>Bhavin Jain1</dc:creator>
      <dc:date>2017-03-09T11:56:41Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159425#M115814</link>
      <description>&lt;P&gt;How to get values for selectbox variables. value is returning &amp;nbsp; choice value not name&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Jan 2018 06:00:58 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159425#M115814</guid>
      <dc:creator>Pothuraju</dc:creator>
      <dc:date>2018-01-03T06:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159426#M115815</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Use g_form.getDisplayValue('variable_name');&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 03 Jan 2018 07:14:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159426#M115815</guid>
      <dc:creator>larstange</dc:creator>
      <dc:date>2018-01-03T07:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159427#M115816</link>
      <description>&lt;P&gt;What if I am using a child widget in variable of catalog item and that child widget is calling a parent widget... and in parent widget I am using "$scope.page.g_form" but it is not working because I think "$scope.page" is used. any way to get this working in parent widget which is being called in child widget?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 08 Jan 2018 13:16:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159427#M115816</guid>
      <dc:creator>saurabhchande</dc:creator>
      <dc:date>2018-01-08T13:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159428#M115817</link>
      <description>&lt;P&gt;If your parent widget is part of the portal and is not embedded in a macro variable, then I don't think your parent widget will have access to the variable values.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Then you need to send all needed values from the child to the parent.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 09 Jan 2018 09:05:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159428#M115817</guid>
      <dc:creator>larstange</dc:creator>
      <dc:date>2018-01-09T09:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159429#M115818</link>
      <description>&lt;P&gt;So, .. just curious, let's say I have multiple fields I need to watch for changes. &amp;nbsp; I have to do a $scope.$watch for each one?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/116276iB1225162BA65DC4A/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Jan 2018 16:20:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159429#M115818</guid>
      <dc:creator>xiaix</dc:creator>
      <dc:date>2018-01-19T16:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: Interact with service portal widget in catalog item</title>
      <link>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159430#M115819</link>
      <description>&lt;P&gt;That would work but this would be better&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_15166034683485521 jive_text_macro" data-renderedposition="49.333335876464844_8_1193_192" jivemacro_uid="_15166034683485521"&gt;&lt;P&gt;&lt;SPAN class="crayon-t" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #800080 !important;"&gt;function&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;$&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;rootScope&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P class="crayon-line crayon-striped-line" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace; padding: 0 5px; font-size: 12px; color: #000000; background: #f7f7f7 !important;"&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-t" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #800080 !important;"&gt;var&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;c&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-o" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-r" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #800080 !important;"&gt;this&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P class="crayon-line" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace; background: 0 center #fdfdfd; padding: 0 5px; font-size: 12px; color: #000000;"&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;$&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;rootScope&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;$&lt;/SPAN&gt;&lt;SPAN class="crayon-e" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #004ed0 !important;"&gt;on&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="crayon-s" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #008000 !important;"&gt;"field.change"&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-t" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #800080 !important;"&gt;function&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;evt&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;,&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;parms&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P class="crayon-line crayon-striped-line" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace; padding: 0 5px; font-size: 12px; color: #000000; background: #f7f7f7 !important;"&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="crayon-st" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #800080 !important;"&gt;if&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;parms&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;field&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;variable_name&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-o" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt;==&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-s" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #008000 !important;"&gt;'value1'&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P class="crayon-line" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace; background: 0 center #fdfdfd; padding: 0 5px; font-size: 12px; color: #000000;"&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;c&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;value1&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-o" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-e" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #004ed0 !important;"&gt;parseInt&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;parms&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;newValue&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P class="crayon-line crayon-striped-line" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace; padding: 0 5px; font-size: 12px; color: #000000; background: #f7f7f7 !important;"&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P class="crayon-line" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace; background: 0 center #fdfdfd; padding: 0 5px; font-size: 12px; color: #000000;"&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="crayon-st" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #800080 !important;"&gt;if&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;parms&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;field&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;variable_name&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-o" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt;==&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-s" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #008000 !important;"&gt;'value2'&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P class="crayon-line crayon-striped-line" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace; padding: 0 5px; font-size: 12px; color: #000000; background: #f7f7f7 !important;"&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;c&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;value2&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-o" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-e" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #004ed0 !important;"&gt;parseInt&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;parms&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;newValue&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P class="crayon-line" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace; background: 0 center #fdfdfd; padding: 0 5px; font-size: 12px; color: #000000;"&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P class="crayon-line crayon-striped-line" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace; padding: 0 5px; font-size: 12px; color: #000000; background: #f7f7f7 !important;"&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;c&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;results&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-o" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt;=&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;c&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;value1&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-o" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt;+&lt;/SPAN&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;c&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;data&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;.&lt;/SPAN&gt;&lt;SPAN class="crayon-v" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #002d7a !important;"&gt;value2&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P class="crayon-line" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace; background: 0 center #fdfdfd; padding: 0 5px; font-size: 12px; color: #000000;"&gt;&lt;SPAN class="crayon-h" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #006fe0 !important;"&gt; &lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;}&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P class="crayon-line crayon-striped-line" style="font-family: Monaco, MonacoRegular, 'Courier New', monospace; padding: 0 5px; font-size: 12px; color: #000000; background: #f7f7f7 !important;"&gt;&lt;SPAN class="crayon-sy" style="font-family: inherit; font-size: inherit !important; font-weight: inherit !important; color: #333333 !important;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Code snipplet taken from &lt;A href="https://serviceportal.io/embedding-widgets-in-service-catalog/" title="https://serviceportal.io/embedding-widgets-in-service-catalog/"&gt;Embedding widgets in Service Catalog - ServicePortal.io - Service Portal Tutorials, Widgets, &amp;amp; Themes&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 22 Jan 2018 06:45:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/servicenow-ai-platform-forum/interact-with-service-portal-widget-in-catalog-item/m-p/1159430#M115819</guid>
      <dc:creator>larstange</dc:creator>
      <dc:date>2018-01-22T06:45:07Z</dc:date>
    </item>
  </channel>
</rss>

