<?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: How to access values in Widget Client Script in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831431#M488357</link>
    <description>&lt;P&gt;Thanks Nitin. Since, it is duration field with the same name and it is split in hours, minutes and seconds.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just need to find way to extract values based on the ID. Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;input type="text" class="form-control ng-valid ng-dirty ng-valid-parse ng-not-empty ng-touched"&lt;BR /&gt;id="&lt;STRONG&gt;dur-hours-u_start_date_of_activity&lt;/STRONG&gt;" ng-model="parts[unit]" ng-disabled="field.isReadonly()"&lt;BR /&gt;ng-change="updateDuration()" title="Hours" role="textbox" aria-invalid="false" style=""&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-not-empty"&lt;BR /&gt;id="&lt;STRONG&gt;dur-minutes-u_start_date_of_activit&lt;/STRONG&gt;y" ng-model="parts[unit]" ng-disabled="field.isReadonly()"&lt;BR /&gt;ng-change="updateDuration()" title="Minutes" role="textbox" aria-invalid="false"&amp;gt;&lt;/P&gt;</description>
    <pubDate>Tue, 11 Aug 2020 14:07:40 GMT</pubDate>
    <dc:creator>ah16</dc:creator>
    <dc:date>2020-08-11T14:07:40Z</dc:date>
    <item>
      <title>How to access values in Widget Client Script</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831429#M488355</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I cloned form widget and how can I access the value of following duration field in Client Scripts for validation?&lt;/P&gt;
&lt;P&gt;&amp;lt;input type="text" class="form-control ng-valid ng-dirty ng-valid-parse ng-not-empty ng-touched" &lt;BR /&gt; id="dur-hours-u_start_date_of_activity" ng-model="parts[unit]" ng-disabled="field.isReadonly()" &lt;BR /&gt; ng-change="updateDuration()" title="Hours" role="textbox" aria-invalid="false" style=""&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-not-empty" &lt;BR /&gt; id="dur-minutes-u_start_date_of_activity" ng-model="parts[unit]" ng-disabled="field.isReadonly()" &lt;BR /&gt; ng-change="updateDuration()" title="Minutes" role="textbox" aria-invalid="false"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ashraf&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 01:15:54 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831429#M488355</guid>
      <dc:creator>ah16</dc:creator>
      <dc:date>2020-08-11T01:15:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to access values in Widget Client Script</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831430#M488356</link>
      <description>&lt;P&gt;You can use the &lt;STRONG&gt;$scope&lt;/STRONG&gt; variable to get or set any values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please look at this link for more info-&amp;nbsp;&lt;A href="https://serviceportal.io/g_form-api-in-embedded-widgets/" rel="nofollow"&gt;https://serviceportal.io/g_form-api-in-embedded-widgets/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Please hit correct based on impact of solution.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Nitin&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 13:49:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831430#M488356</guid>
      <dc:creator>Nitin_NOW</dc:creator>
      <dc:date>2020-08-11T13:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to access values in Widget Client Script</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831431#M488357</link>
      <description>&lt;P&gt;Thanks Nitin. Since, it is duration field with the same name and it is split in hours, minutes and seconds.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just need to find way to extract values based on the ID. Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;input type="text" class="form-control ng-valid ng-dirty ng-valid-parse ng-not-empty ng-touched"&lt;BR /&gt;id="&lt;STRONG&gt;dur-hours-u_start_date_of_activity&lt;/STRONG&gt;" ng-model="parts[unit]" ng-disabled="field.isReadonly()"&lt;BR /&gt;ng-change="updateDuration()" title="Hours" role="textbox" aria-invalid="false" style=""&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;input type="text" class="form-control ng-pristine ng-untouched ng-valid ng-not-empty"&lt;BR /&gt;id="&lt;STRONG&gt;dur-minutes-u_start_date_of_activit&lt;/STRONG&gt;y" ng-model="parts[unit]" ng-disabled="field.isReadonly()"&lt;BR /&gt;ng-change="updateDuration()" title="Minutes" role="textbox" aria-invalid="false"&amp;gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 14:07:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831431#M488357</guid>
      <dc:creator>ah16</dc:creator>
      <dc:date>2020-08-11T14:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to access values in Widget Client Script</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831432#M488358</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;ng-model is used for the two way binding means it bind the value on HTML and server side. So if you want to access the declared variable in HTML used ng-model and in client script you can access it by &lt;STRONG&gt;c.variable or $scope.variable name&lt;/STRONG&gt;, where c is work as a controller in angularjs.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://docs.servicenow.com/bundle/helsinki-servicenow-platform/page/build/service-portal/concept/c_Scripting.html" rel="nofollow"&gt;Widget scripting&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=5bf6c8dfdb7297c0a39a0b55ca9619fb" rel="nofollow"&gt;https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=5bf6c8dfdb7297c0a39a0b55ca9619fb&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Mark it correct or helpful.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Bhagyashri Sorte.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 14:13:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831432#M488358</guid>
      <dc:creator>Bhagyashri Sort</dc:creator>
      <dc:date>2020-08-11T14:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to access values in Widget Client Script</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831433#M488359</link>
      <description>&lt;P&gt;Thanks for your response. I'm trying&amp;nbsp;to validations on the duration field and need a way to get data based on ID. Since, variable name is same for hours,minutes and second&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 14:23:41 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831433#M488359</guid>
      <dc:creator>ah16</dc:creator>
      <dc:date>2020-08-11T14:23:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to access values in Widget Client Script</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831434#M488360</link>
      <description>&lt;P&gt;Try g_form.getDisplayValue().&lt;/P&gt;
&lt;P&gt;&lt;A href="https://serviceportal.io/docs/documentation/client_scripting.md" rel="nofollow"&gt;https://serviceportal.io/docs/documentation/client_scripting.md&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Aug 2020 14:33:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-access-values-in-widget-client-script/m-p/1831434#M488360</guid>
      <dc:creator>Bhagyashri Sort</dc:creator>
      <dc:date>2020-08-11T14:33:01Z</dc:date>
    </item>
  </channel>
</rss>

