<?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: autopopulate field values (of user) using glideAjax in ITSM forum</title>
    <link>https://www.servicenow.com/community/itsm-forum/autopopulate-field-values-of-user-using-glideajax/m-p/536998#M108777</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;This article which I wrote a while back gives some good explanation and examples:&lt;BR /&gt;- 2020-01-10&amp;nbsp;&lt;A href="https://community.servicenow.com/community?id=community_article&amp;amp;sys_id=c918c3b8db968c5013b5fb2439961918" target="_blank" rel="noopener noreferrer"&gt;Client Side Scripting: Go for GlideAjax (with getXMLAnswer)!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If my answer helped you in any way, please then mark it as helpful.&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;BR /&gt;Mark&lt;BR /&gt;&lt;EM&gt;2020-2022 ServiceNow Community MVP&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;2020-2022 ServiceNow Developer MVP&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;---&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.linkedin.com/in/markroethof/" target="_blank" rel="noopener noreferrer"&gt;LinkedIn&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.servicenow.com/community?id=community_blog&amp;amp;sys_id=14e51965db2200d013b5fb24399619fb" target="_blank" rel="noopener noreferrer"&gt;Community article, blog, video list&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 19 Jun 2022 16:41:14 GMT</pubDate>
    <dc:creator>Mark Roethof</dc:creator>
    <dc:date>2022-06-19T16:41:14Z</dc:date>
    <item>
      <title>autopopulate field values (of user) using glideAjax</title>
      <link>https://www.servicenow.com/community/itsm-forum/autopopulate-field-values-of-user-using-glideajax/m-p/536997#M108776</link>
      <description>&lt;P&gt;Hello, I am using below client script to auto populate field values ('manager' and 'lastname'), when user in 'requested_for' field changes&lt;/P&gt;
&lt;P&gt;function onChange(control, oldValue, newValue, isLoading, isTemplate) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp;if (isLoading || newValue === '') {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; return;&lt;BR /&gt;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;var id = g_form.getValue('u_requested_for'); &amp;nbsp;// ref to sys_user&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; var gr = new GlideRecord('sys_user');&lt;BR /&gt;&amp;nbsp; &amp;nbsp; gr.addQuery('sys_id',id);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; gr.query();&lt;BR /&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; while(gr.next()) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g_form.setValue('u_manager',gr.manager);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g_form.setValue('u_lastname',gr.last_name);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As its not best practice to use gliderecord in client script, can someone help to get the code for script include and client script, if I want this to get done using 'GlideAjax'.&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 16:38:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/autopopulate-field-values-of-user-using-glideajax/m-p/536997#M108776</guid>
      <dc:creator>SWAPNIL KULKARN</dc:creator>
      <dc:date>2022-06-19T16:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: autopopulate field values (of user) using glideAjax</title>
      <link>https://www.servicenow.com/community/itsm-forum/autopopulate-field-values-of-user-using-glideajax/m-p/536998#M108777</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;
&lt;P&gt;This article which I wrote a while back gives some good explanation and examples:&lt;BR /&gt;- 2020-01-10&amp;nbsp;&lt;A href="https://community.servicenow.com/community?id=community_article&amp;amp;sys_id=c918c3b8db968c5013b5fb2439961918" target="_blank" rel="noopener noreferrer"&gt;Client Side Scripting: Go for GlideAjax (with getXMLAnswer)!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;If my answer helped you in any way, please then mark it as helpful.&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;BR /&gt;Mark&lt;BR /&gt;&lt;EM&gt;2020-2022 ServiceNow Community MVP&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;2020-2022 ServiceNow Developer MVP&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;---&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.linkedin.com/in/markroethof/" target="_blank" rel="noopener noreferrer"&gt;LinkedIn&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.servicenow.com/community?id=community_blog&amp;amp;sys_id=14e51965db2200d013b5fb24399619fb" target="_blank" rel="noopener noreferrer"&gt;Community article, blog, video list&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 16:41:14 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/autopopulate-field-values-of-user-using-glideajax/m-p/536998#M108777</guid>
      <dc:creator>Mark Roethof</dc:creator>
      <dc:date>2022-06-19T16:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: autopopulate field values (of user) using glideAjax</title>
      <link>https://www.servicenow.com/community/itsm-forum/autopopulate-field-values-of-user-using-glideajax/m-p/536999#M108778</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;
&lt;P&gt;You can refer to below community article which meets your requirement.&lt;/P&gt;
&lt;P&gt;Also, would suggest to have a look at Article shared by Mark above, will be helpful in order to understand how Ajax works.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_question&amp;amp;sys_id=8865f65edb46f700f21f5583ca9619d5"&gt;Get Manager name based an selected user&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Feel free to mark correct, If I answered your query.&lt;/P&gt;
&lt;P&gt;Will be helpful for future visitors looking for similar questions &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 16:43:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/autopopulate-field-values-of-user-using-glideajax/m-p/536999#M108778</guid>
      <dc:creator>Aman Kumar S</dc:creator>
      <dc:date>2022-06-19T16:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: autopopulate field values (of user) using glideAjax</title>
      <link>https://www.servicenow.com/community/itsm-forum/autopopulate-field-values-of-user-using-glideajax/m-p/537000#M108779</link>
      <description>&lt;P&gt;Do be aware, that the link you are sharing, the answer marked as correct a performance issue if using this for a reference field/variable.&lt;/P&gt;
&lt;P&gt;If my answer helped you in any way, please then mark it as helpful.&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;BR /&gt;Mark&lt;BR /&gt;&lt;EM&gt;2020-2022 ServiceNow Community MVP&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;2020-2022 ServiceNow Developer MVP&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;---&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.linkedin.com/in/markroethof/" target="_blank" rel="noopener noreferrer"&gt;LinkedIn&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://community.servicenow.com/community?id=community_blog&amp;amp;sys_id=14e51965db2200d013b5fb24399619fb" target="_blank" rel="noopener noreferrer"&gt;Community article, blog, video list&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Jun 2022 16:50:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/itsm-forum/autopopulate-field-values-of-user-using-glideajax/m-p/537000#M108779</guid>
      <dc:creator>Mark Roethof</dc:creator>
      <dc:date>2022-06-19T16:50:27Z</dc:date>
    </item>
  </channel>
</rss>

