<?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 Inserting data into a table in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913481#M570407</link>
    <description>&lt;P&gt;Hi Everyone, I was originally trying to build a record producer that would map to a custom table, but the formatting limitations of record producers is making me consider just building a Macro or UI Page instead. &amp;nbsp; If I were to go this route, I plan to create a custom form using CSS/HTML, but am curious how to map variables back to my table. &amp;nbsp; I did a bunch of googling and wound up here: &lt;A href="http://wiki.servicenow.com/index.php?title=GlideRecord#Insert_Methods" rel="nofollow" style="font-family: arial, sans-serif; color: #3778c7;" target="_blank" title="http://wiki.servicenow.com/index.php?title=GlideRecord#Insert_Methods"&gt;http://wiki.servicenow.com/index.php?title=GlideRecord#Insert_Methods.&lt;/A&gt; &amp;nbsp; I'm not familiar with javascript so was wondering if someone can confirm that this is the right approach to mapping variables back to and inserting into an existing table. &amp;nbsp; Also, can someone explain to me how this code works? &amp;nbsp; Would this be a client side script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example if i have a table named u_basic_info with a field called u_credit_card_number and I build a custom form with a insert text field, &amp;lt;input type="text" id="ccnum" name="u_credit_card_number"&amp;gt;, how would I generate the below script so that when a user enters in their credit card number, it gets mapped back to the u_credit_card_number field in my my table u_basic_info?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kw2" style="color: #003366; font-weight: bold;"&gt;var&lt;/SPAN&gt; gr &lt;SPAN class="sy0" style="color: #339933;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="kw2" style="color: #003366; font-weight: bold;"&gt;new&lt;/SPAN&gt; GlideRecord&lt;SPAN class="br0" style="color: #009900;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="st0" style="color: #3366cc;"&gt;'to_do'&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;gr.&lt;SPAN class="me1" style="color: #660066;"&gt;initialize&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;gr.&lt;SPAN class="kw3" style="color: #000066;"&gt;name&lt;/SPAN&gt; &lt;SPAN class="sy0" style="color: #339933;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="st0" style="color: #3366cc;"&gt;'first to do item'&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;gr.&lt;SPAN class="me1" style="color: #660066;"&gt;description&lt;/SPAN&gt; &lt;SPAN class="sy0" style="color: #339933;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="st0" style="color: #3366cc;"&gt;'learn about GlideRecord'&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;gr.&lt;SPAN class="me1" style="color: #660066;"&gt;insert&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 22 Sep 2016 14:12:26 GMT</pubDate>
    <dc:creator>yundlu316</dc:creator>
    <dc:date>2016-09-22T14:12:26Z</dc:date>
    <item>
      <title>Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913481#M570407</link>
      <description>&lt;P&gt;Hi Everyone, I was originally trying to build a record producer that would map to a custom table, but the formatting limitations of record producers is making me consider just building a Macro or UI Page instead. &amp;nbsp; If I were to go this route, I plan to create a custom form using CSS/HTML, but am curious how to map variables back to my table. &amp;nbsp; I did a bunch of googling and wound up here: &lt;A href="http://wiki.servicenow.com/index.php?title=GlideRecord#Insert_Methods" rel="nofollow" style="font-family: arial, sans-serif; color: #3778c7;" target="_blank" title="http://wiki.servicenow.com/index.php?title=GlideRecord#Insert_Methods"&gt;http://wiki.servicenow.com/index.php?title=GlideRecord#Insert_Methods.&lt;/A&gt; &amp;nbsp; I'm not familiar with javascript so was wondering if someone can confirm that this is the right approach to mapping variables back to and inserting into an existing table. &amp;nbsp; Also, can someone explain to me how this code works? &amp;nbsp; Would this be a client side script?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example if i have a table named u_basic_info with a field called u_credit_card_number and I build a custom form with a insert text field, &amp;lt;input type="text" id="ccnum" name="u_credit_card_number"&amp;gt;, how would I generate the below script so that when a user enters in their credit card number, it gets mapped back to the u_credit_card_number field in my my table u_basic_info?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="kw2" style="color: #003366; font-weight: bold;"&gt;var&lt;/SPAN&gt; gr &lt;SPAN class="sy0" style="color: #339933;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="kw2" style="color: #003366; font-weight: bold;"&gt;new&lt;/SPAN&gt; GlideRecord&lt;SPAN class="br0" style="color: #009900;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="st0" style="color: #3366cc;"&gt;'to_do'&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;gr.&lt;SPAN class="me1" style="color: #660066;"&gt;initialize&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;gr.&lt;SPAN class="kw3" style="color: #000066;"&gt;name&lt;/SPAN&gt; &lt;SPAN class="sy0" style="color: #339933;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="st0" style="color: #3366cc;"&gt;'first to do item'&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;gr.&lt;SPAN class="me1" style="color: #660066;"&gt;description&lt;/SPAN&gt; &lt;SPAN class="sy0" style="color: #339933;"&gt;=&lt;/SPAN&gt; &lt;SPAN class="st0" style="color: #3366cc;"&gt;'learn about GlideRecord'&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;gr.&lt;SPAN class="me1" style="color: #660066;"&gt;insert&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;(&lt;/SPAN&gt;&lt;SPAN class="br0" style="color: #009900;"&gt;)&lt;/SPAN&gt;&lt;SPAN class="sy0" style="color: #339933;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 14:12:26 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913481#M570407</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2016-09-22T14:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913482#M570408</link>
      <description>&lt;P&gt;So basically what you have to do is, first you have to get the value what someone has given in &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;u_credit_card_number in UI page.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;You must have some button on that page. And after clicking that input will go to the table.&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: #666666; font-family: arial, sans-serif;"&gt;Example: &amp;nbsp; &lt;STRONG&gt;onClick="submitRequest();"&lt;/STRONG&gt;&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: #666666; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;&amp;lt;script&amp;gt;&lt;/STRONG&gt;&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: #666666; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;function submitRequest()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;var get = document.getElementById('&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;ccnum').value;&lt;/SPAN&gt;&lt;/STRONG&gt;&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: #666666; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;var gr = new GlideRecord('u_basic_info');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;gr.initialize();&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;gr.&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;u_credit_card_number = get;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;gr.insert();&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&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;&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;&lt;STRONG&gt;&lt;STRONG style="color: #666666; font-family: arial, sans-serif;"&gt;&amp;lt;/script&amp;gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Sep 2016 14:22:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913482#M570408</guid>
      <dc:creator>tanumoy</dc:creator>
      <dc:date>2016-09-22T14:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913483#M570409</link>
      <description>&lt;P&gt;Hi Tanuomy, thank you, you've been helping me so much! &amp;nbsp; One follow up question regarding onClick button, if I create this Macro or UI page with the script you provided above, and I decide to insert it into a Record Producer that already has a default Submit button, would that be sufficient? &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Sep 2016 14:36:23 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913483#M570409</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2016-09-22T14:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913484#M570410</link>
      <description>&lt;P&gt;I just tried that in my dev instance. If you create a UI Page with the below code and create a UI Page type variable in a catalog item/record producer, it will insert a record in that table whenever that catalog item/record producer is loading. No need to submit anywhere.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;?xml version="1.0" encoding="utf-8" ?&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null"&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;lt;input type="text" id="ccnum" name="u_credit_card_number"&amp;gt;Text&amp;lt;/input&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;lt;script&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;var get = document.getElementById('ccnum').value;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;var gr = new GlideRecord('incident');&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;gr.initialize();&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;gr.short_description = "From UI page";&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;gr.insert();&lt;/STRONG&gt;&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;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;/script&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;/j:jelly&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I am not sure if you want this or not but this is not a good practice I believe.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Sep 2016 17:03:07 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913484#M570410</guid>
      <dc:creator>tanumoy</dc:creator>
      <dc:date>2016-09-22T17:03:07Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913485#M570411</link>
      <description>&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;Hi Tanumoy, your code works great! &amp;nbsp; I have one more follow up question (excuse me, I'm brand new to JS), your below code will enter one variable into the table, what if I have 10 different variables that I want to enter into the same table upon Submit? &amp;nbsp; What would that syntax look like?&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;function submitRequest()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;var get = document.getElementById('&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;ccnum').value;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;var gr = new GlideRecord('u_basic_info');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.initialize();&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;u_credit_card_number = get;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.insert();&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 22 Sep 2016 19:21:55 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913485#M570411</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2016-09-22T19:21:55Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913486#M570412</link>
      <description>&lt;P&gt;If you have the input type in UI page then use document.getElementbyId('field_id').value to get the value. Then set that value to the table field by using gr.field_name.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;function submitRequest()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;var get = document.getElementById('&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;ccnum').value;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;var gr = new GlideRecord('u_basic_info');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.initialize();&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.field_name1 = &lt;STRONG style="font-family: inherit; font-style: inherit;"&gt;document.getElementById('&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;abc').value;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-style: inherit; font-weight: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.field_name2 = &lt;STRONG style="font-family: inherit; font-style: inherit;"&gt;document.getElementById('&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;xyz').value;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-style: inherit; font-weight: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-weight: inherit; font-family: inherit; font-style: inherit;"&gt;gr.field_name3 = "Test Here"; //and so on &lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;u_credit_card_number = get;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.insert();&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="js-outcome-helpful-counts-container j-outcome-helpful-counts-container font-color-okay" data-display-overall="true" data-helpful-count="0" data-object-id="1008839" data-object-type="2" data-overall-count="0" style="margin: 1em -50px 1em 0; font-weight: bold; font-style: inherit; font-size: 13px; font-family: inherit; color: #d1222b;"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Sep 2016 00:17:17 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913486#M570412</guid>
      <dc:creator>tanumoy</dc:creator>
      <dc:date>2016-09-23T00:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913487#M570413</link>
      <description>&lt;P&gt;Thanks Tanumoy, so is the 2nd line needed? &amp;nbsp; Should the code be like this?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;function submitRequest()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;{&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt; &lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;var gr = new GlideRecord('u_basic_info');&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.initialize();&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.field_name1 = &lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;document.getElementById('&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;name1').value;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.field_name2 = &lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;document.getElementById('&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;name2').value;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.field_name3 = &lt;STRONG style="color: #666666; font-family: inherit; font-style: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;document.getElementById('&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;name3').value;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;gr.insert();&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;&lt;STRONG style="font-style: inherit; font-family: inherit;"&gt;}&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Sep 2016 00:36:56 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913487#M570413</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2016-09-23T00:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913488#M570414</link>
      <description>&lt;P&gt;Your code looks perfect to me. In case you just have to set any static value then the option is to add line like &lt;STRONG style="color: #666666; font-weight: inherit; font-family: inherit; font-style: inherit;"&gt;gr.field_name3 = "Test Here"; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Sep 2016 01:10:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913488#M570414</guid>
      <dc:creator>tanumoy</dc:creator>
      <dc:date>2016-09-23T01:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913489#M570415</link>
      <description>&lt;P&gt;Hi Tanumoy, very strange...When I use the code above on 3-4 variables, it works great. &amp;nbsp; However, my form has 30+ fields, when I try it with all of the fields, the submit and page redirect stop working. &amp;nbsp; It's as if SN can't handle the script. &amp;nbsp; Any thoughts on this?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Sep 2016 23:48:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913489#M570415</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2016-09-23T23:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913490#M570416</link>
      <description>&lt;P&gt;could you please post the full code.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Also make sure that u_basic_info has all the fields present whatever you mentioned in the script (field names should be same as in the table also).&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 24 Sep 2016 04:21:24 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913490#M570416</guid>
      <dc:creator>tanumoy</dc:creator>
      <dc:date>2016-09-24T04:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913491#M570417</link>
      <description>&lt;P&gt;Hi Tanumoy, here's my full code below: &lt;A href="https://jsfiddle.net/yundlu/45dc1os4/" title="https://jsfiddle.net/yundlu/45dc1os4/"&gt;Edit fiddle - JSFiddle&lt;/A&gt;. &amp;nbsp; I've added all of my variables back into the code and tested the form by entering a value and pressing submit, variable by variable. &amp;nbsp; The submit button doesn't work until I enter a certain number of variables in the form. &amp;nbsp; I've checked my syntax countless times now and can't seem to locate the issue. &amp;nbsp; Thanks.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Sep 2016 03:51:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913491#M570417</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2016-09-26T03:51:01Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913492#M570418</link>
      <description>&lt;P&gt;What I have noticed that you have use &lt;STRONG&gt;document.getElementById('&amp;lt;variable_name&amp;gt;').value;&lt;/STRONG&gt; for all type of inputs like text, option, select-box etc. But this thing will work on text input not all of the inputs.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Like example for select-box you have to use &lt;STRONG&gt;document.getElementById('&amp;lt;variable_name&amp;gt;').innerHTML;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Please look into the below link to get what we need to use for different type of inputs.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="http://www.w3schools.com/js/js_htmldom.asp" title="http://www.w3schools.com/js/js_htmldom.asp"&gt;JavaScript HTML DOM&lt;/A&gt; &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Sep 2016 12:48:21 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913492#M570418</guid>
      <dc:creator>tanumoy</dc:creator>
      <dc:date>2016-09-26T12:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913493#M570419</link>
      <description>&lt;P&gt;Hi &lt;A title="tanumoy" __default_attr="35358" __jive_macro_name="user" class="jive-link-profile-small jive_macro jive_macro_user" data-id="35358" data-objecttype="3" data-orig-content="tanumoy" data-renderedposition="10_25_74_16" data-type="person" href="https://www.servicenow.com/community?id=community_user_profile&amp;amp;user=1bf09aa1db981fc09c9ffb651f9619f7"&gt;tanumoy&lt;/A&gt;, I have a follow up question that is really just for my own knowledge. &amp;nbsp; I've read that GlideAjax may be a better option for scripts such as this. &amp;nbsp; Just out of curiosity, what would the syntax be for the below GlideRecord code? &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;function submitRequest()&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;var gr = new GlideRecord('u_basic_info');&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;gr.initialize();&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;gr.field_name1 = document.getElementById('&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;name1').value;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;gr.field_name2 = document.getElementById('&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;name2').value;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;gr.field_name3 = document.getElementById('&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;name3').value;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;gr.insert();&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 26 Sep 2016 21:41:37 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913493#M570419</guid>
      <dc:creator>yundlu316</dc:creator>
      <dc:date>2016-09-26T21:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting data into a table</title>
      <link>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913494#M570420</link>
      <description>&lt;P&gt;You can try below codes. But please note I have not tested it in my instance.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;UI page code:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;script&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function submitRequest()&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-style: inherit; font-weight: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var field1 = document.getElementById('&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;name1').value;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-style: inherit; font-weight: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var field2 = document.getElementById('&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;name2').value;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-style: inherit; font-weight: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var field3 = document.getElementById('&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;name3').value;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var ajax = new GlideAjax('saveDataToTable'); &amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ajax.addParam('sysparm_name','saveData'); &amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ajax.addParam('sysparm_&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;field1&lt;/SPAN&gt;', &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;field1&lt;/SPAN&gt;);&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ajax.addParam('sysparm_&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;field2&lt;/SPAN&gt;', &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;field2&lt;/SPAN&gt;);&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ajax.addParam('sysparm_&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;field3&lt;/SPAN&gt;', &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;field3&lt;/SPAN&gt;);&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ajax.getXML(doSomething); &amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; function doSomething(response){ &amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; var answer = response.responseXML.documentElement.getAttribute("answer"); &amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (answer)&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; alert('Data has been saved successfully');&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; } &amp;nbsp; &amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; }&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt;&amp;lt;/script&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Script Include:&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Name: &lt;STRONG&gt;saveDataToTable&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Client Callable: &lt;STRONG&gt;True&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-family: inherit;"&gt;Code:&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;var saveDataToTable = Class.create();&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;saveDataToTable.prototype = Object.extendsObject(AbstractAjaxProcessor, {&lt;/STRONG&gt;&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;&lt;STRONG&gt; &amp;nbsp; saveData: function(){ &amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; var &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;fname1 &lt;/SPAN&gt;= this.getParameter('sysparm_&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;field1&lt;/SPAN&gt;'); &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; var &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;fname2 &lt;/SPAN&gt;= this.getParameter('sysparm_&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;field2&lt;/SPAN&gt;'); &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; var &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;fname3 &lt;/SPAN&gt;= this.getParameter('sysparm_&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;field3&lt;/SPAN&gt;'); &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt; &amp;nbsp; var gr = new GlideRecord('u_basic_info');&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt; &amp;nbsp; gr.initialize();&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt; &amp;nbsp; gr.field_name1 = &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;fname1&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt; &amp;nbsp; gr.field_name2 = &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;fname2&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt; &amp;nbsp; gr.field_name3 = &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;fname3&lt;/SPAN&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P style="font-weight: inherit; font-style: inherit; font-family: arial, sans-serif; color: #666666;"&gt;&lt;STRONG style="font-family: inherit; font-style: inherit;"&gt; &amp;nbsp; var sys_id = gr.insert();&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; return &lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;sys_id&lt;/SPAN&gt;; &amp;nbsp; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;}, &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; type: 'saveDataToTable'&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;});&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Sep 2016 08:56:15 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/inserting-data-into-a-table/m-p/1913494#M570420</guid>
      <dc:creator>tanumoy</dc:creator>
      <dc:date>2016-09-27T08:56:15Z</dc:date>
    </item>
  </channel>
</rss>

