<?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 Populating a Variable on sc_req_item table on update of catalog variable in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107445#M764371</link>
    <description>&lt;P&gt;I have a need to be able to populate a variable located on the request item table (u_tra_amnt) when a catalog variable (tra_amnt_given) is updated from the task level. I know I need a business rule and I have been able to run a couple and successfully populate that variable on submit, but if any changes are made to that variable, it doesn't update. I am using after update functionality, but it's not working. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script I am using is current.u_tra_amnt = current.variables.tra_amnt_given;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's a BR on the sc_req_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all in advance!&lt;/P&gt;</description>
    <pubDate>Wed, 21 Dec 2016 15:46:02 GMT</pubDate>
    <dc:creator>AlexC1256158230</dc:creator>
    <dc:date>2016-12-21T15:46:02Z</dc:date>
    <item>
      <title>Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107445#M764371</link>
      <description>&lt;P&gt;I have a need to be able to populate a variable located on the request item table (u_tra_amnt) when a catalog variable (tra_amnt_given) is updated from the task level. I know I need a business rule and I have been able to run a couple and successfully populate that variable on submit, but if any changes are made to that variable, it doesn't update. I am using after update functionality, but it's not working. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script I am using is current.u_tra_amnt = current.variables.tra_amnt_given;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's a BR on the sc_req_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any thoughts??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all in advance!&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2016 15:46:02 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107445#M764371</guid>
      <dc:creator>AlexC1256158230</dc:creator>
      <dc:date>2016-12-21T15:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107446#M764372</link>
      <description>&lt;P&gt;Hi Alex - you can't dot walk into variables, so your "current.variables.tra_amnt_given" wouldn't work. Below is a reply I provided for another &lt;A title="" _jive_internal="true" href="https://www.servicenow.com/community?id=community_question&amp;amp;sys_id=327ac7e9db5cdbc01dcaf3231f961914"&gt;post &lt;/A&gt;that helped resolve the issue.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;A href="http://wiki.servicenow.com/?title=Using_GlideRecord_to_Query_Tables#Querying_Service_Catalog_Tables"&gt;&lt;SPAN&gt;Using GlideRecord to Query Tables&lt;/SPAN&gt; &lt;SPAN class="mw-headline"&gt;3.6 &amp;nbsp; Querying Service Catalog Tables &lt;/SPAN&gt;&lt;/A&gt;reads:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;PRE __jive_macro_name="quote" class="jive_macro_quote jive_text_macro" data-renderedposition="123_8_765_125"&gt;&lt;P&gt;You cannot directly query the variables of the Service Catalog Request Item table [sc_req_item]. Instead, query the Variable Ownership table [sc_item_option_mtom] by adding two queries, one for the variable name and another for the value. The query returns the many-to-many relationship, which you can dot-walk to the requested item. The following example finds the request items that have the variable named 'item_name' with a value of 'item_value' and displays the request item numbers:&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;and provides this example:&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_14811618374422365 jive_text_macro" data-renderedposition="321_8_765_128" jivemacro_uid="_14811618374422365"&gt;&lt;P&gt;var gr = new GlideRecord('sc_item_option_mtom');&lt;BR /&gt;gr.addQuery('sc_item_option.item_option_new.name','item_name');&lt;BR /&gt;gr.addQuery('sc_item_option.value','item_value');&lt;BR /&gt;gr.query();&lt;BR /&gt;&lt;BR /&gt;while (gr.next()) {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; gs.addInfoMessage(gr.request_item.number);&lt;BR /&gt;}&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;EM&gt;Please feel free to connect, follow, mark helpful / answer, like, endorse.&lt;/EM&gt;&lt;/P&gt;&lt;BR /&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD style="width: 172px;"&gt;John Chun, &lt;SPAN style="font-size: 8pt;"&gt;PhD PMP&lt;/SPAN&gt; &lt;A href="http://linkedin.com/in/DrJohnChun"&gt;&lt;IMG alt="see John's LinkedIn profile" class="image-2 jive-image" src="http://megaicons.net/static/img/icons_sizes/182/456/16/linkedin-icon.png" style="height: auto; vertical-align: -13px;" title="see John's LinkedIn profile" /&gt;&lt;/A&gt;&lt;P&gt;&lt;A href="http://snowaid.com/"&gt;&lt;IMG alt="visit snowaid" class="image-1 jive-image" src="http://snowaid.com/images/signature.png" style="height: auto; margin-top: -9px;" title="visit snowaid" /&gt;&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;&lt;/TD&gt;&lt;TD&gt;&lt;A _jive_internal="true" href="https://www.servicenow.com/people/drjohnchun/content"&gt;&lt;IMG alt="ServiceNow Advocate" class="image-3 jive-image" src="http://snowaid.com/images/sn_advocate_135x48.png" style="margin-top: -3px;" /&gt;&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;A title="" _jive_internal="true" href="https://www.servicenow.com/community?id=community_forum&amp;amp;sys_id=76299a2ddbd897c068c1fb651f96196a"&gt;Winner of November 2016 Members' Choice Award&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 15:50:49 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107446#M764372</guid>
      <dc:creator>drjohnchun</dc:creator>
      <dc:date>2016-12-21T15:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107447#M764373</link>
      <description>&lt;P&gt;Alright, so I think I see what you are saying in this but I might need a little more hand holding as I want it to populate a variable and not just give me the item numbers that have this variable. &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;So... if I were to make a business rule....&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;Table: sc_req_item&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;when: after&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;update: true&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;script:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var gr = new GlideRecord('sc_item_option_mtom');&lt;BR /&gt;gr.addQuery('sc_item_option.item_option_new.name','tra_amnt_given');&lt;BR /&gt;gr.addQuery('sc_item_option.value','tra_amnt_given');&lt;BR /&gt;gr.query();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;while (gr.next()) {&lt;BR /&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; ??????????????????????????;&lt;BR /&gt;}&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 15:59:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107447#M764373</guid>
      <dc:creator>AlexC1256158230</dc:creator>
      <dc:date>2016-12-21T15:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107448#M764374</link>
      <description>&lt;P&gt;Here's what can be done first to make sure the query is working. Can you run this in &lt;STRONG&gt;Background Script&lt;/STRONG&gt; and tell me what the output is? Use the &lt;SPAN style="font-family: courier new,courier;"&gt;sys_id&lt;/SPAN&gt; of a &lt;SPAN style="font-family: courier new,courier;"&gt;sc_req_item&lt;/SPAN&gt; record that you want to test with and also set the &lt;SPAN style="font-family: courier new,courier;"&gt;item_name&lt;/SPAN&gt; and &lt;SPAN style="font-family: courier new,courier;"&gt;item_value&lt;/SPAN&gt; variables to the correct values before running it:&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_14823385752214236 jive_text_macro" data-renderedposition="92.9000015258789_8_932_112" jivemacro_uid="_14823385752214236"&gt;&lt;P&gt;var sys_id = current.sys_id, item_name = 'tra_amnt_given', item_value = '???'; &amp;nbsp; // set correct values here&lt;BR /&gt;var gr = new GlideRecord('sc_item_option_mtom');&lt;BR /&gt;gr.addQuery('request_item',sys_id);&lt;BR /&gt;gr.addQuery('sc_item_option.item_option_new.name',item_name);&lt;BR /&gt;gr.addQuery('sc_item_option.value',item_value);&lt;BR /&gt;gr.query();&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gs.info(gr.getRowCount());&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Dec 2016 16:44:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107448#M764374</guid>
      <dc:creator>drjohnchun</dc:creator>
      <dc:date>2016-12-21T16:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107449#M764375</link>
      <description>&lt;P&gt;Why to write BR on Request item table when your variable is getting updated on mtom table.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;From what I got your requirement, you need to write BR sc_item_option table&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;BR table- sc_item_option&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;condition- item_option_new.name==&lt;SPAN style="color: #666666; font-family: arial, sans-serif;"&gt;tra_amnt_given&lt;/SPAN&gt;&amp;amp;&amp;amp; current.value changes()&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;script-&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var gr = new GlideRecord('sc_item_option_mtom'); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gr.addEncodedQuery('sc_item_option.value='+current.value+'^sc_item_option.item_option_new.name=&lt;SPAN style="background-color: #ffffff; color: #666666; font-family: arial, sans-serif;"&gt;tra_amnt_given&lt;/SPAN&gt;'); &amp;nbsp; //double check my encoded query string syntax&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;gr.query(); &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;if(gr.next()) { &lt;/P&gt;&lt;BR /&gt;&lt;P&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; gr.request_item.&lt;SPAN style="background-color: #ffffff; color: #666666; font-family: arial, sans-serif;"&gt;u_tra_amnt= current.value;&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #666666; font-family: arial, sans-serif;"&gt; &amp;nbsp; &amp;nbsp; gr.update();&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;} &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 16:58:44 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107449#M764375</guid>
      <dc:creator>purbali1</dc:creator>
      <dc:date>2016-12-21T16:58:44Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107450#M764376</link>
      <description>&lt;P&gt;it says there is an error at line one. I assume I am supposed to just put a test value in there for an item that I have already entered?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:12:12 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107450#M764376</guid>
      <dc:creator>AlexC1256158230</dc:creator>
      <dc:date>2016-12-21T17:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107451#M764377</link>
      <description>&lt;P&gt;Can you post the script you're using? You'll need to set all 3 variables to correct values.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:14:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107451#M764377</guid>
      <dc:creator>drjohnchun</dc:creator>
      <dc:date>2016-12-21T17:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107452#M764378</link>
      <description>&lt;P&gt;var sys_id = current.sys_id&lt;BR /&gt;var item_name = 'tra_amnt_given'&lt;BR /&gt;var item_value = 23; &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var gr = new GlideRecord('sc_item_option_mtom'); &amp;nbsp; &lt;BR /&gt;gr.addQuery('request_item',sys_id); &amp;nbsp; &lt;BR /&gt;gr.addQuery('sc_item_option.item_option_new.name',item_name); &amp;nbsp; &lt;BR /&gt;gr.addQuery('sc_item_option.value',item_value); &amp;nbsp; &lt;BR /&gt;gr.query(); &amp;nbsp; &lt;BR /&gt;gs.info(gr.getRowCount());&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:18:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107452#M764378</guid>
      <dc:creator>AlexC1256158230</dc:creator>
      <dc:date>2016-12-21T17:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107453#M764379</link>
      <description>&lt;P&gt;You need to replace current.sys_id with the sys_id of the test record from sc_req_item - do you know how to get that? "current.sys_id" works in your BR, but not in Background Script.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:23:28 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107453#M764379</guid>
      <dc:creator>drjohnchun</dc:creator>
      <dc:date>2016-12-21T17:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107454#M764380</link>
      <description>&lt;P&gt;That didn't seem to work. and I wish I could double check your encoded query but I'll admit, I don't know what the sytax is supposed to be for that. I don't ever use encoded query. &lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:23:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107454#M764380</guid>
      <dc:creator>AlexC1256158230</dc:creator>
      <dc:date>2016-12-21T17:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107455#M764381</link>
      <description>&lt;P&gt;Ah gotchya. Now with this:&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var sys_id = '9391db4a0fb3a680ac50305be1050e9f';&lt;BR /&gt;var item_name = 'tra_amnt_given';&lt;BR /&gt;var item_value = '23'; &amp;nbsp; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var gr = new GlideRecord('sc_item_option_mtom'); &amp;nbsp; &lt;BR /&gt;gr.addQuery('request_item',sys_id); &amp;nbsp; &lt;BR /&gt;gr.addQuery('sc_item_option.item_option_new.name',item_name); &amp;nbsp; &lt;BR /&gt;gr.addQuery('sc_item_option.value',item_value); &amp;nbsp; &lt;BR /&gt;gr.query(); &amp;nbsp; &lt;BR /&gt;gs.info(gr.getRowCount());&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;it is returning: *** Script: 0&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:27:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107455#M764381</guid>
      <dc:creator>AlexC1256158230</dc:creator>
      <dc:date>2016-12-21T17:27:38Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107456#M764382</link>
      <description>&lt;P&gt;wait wait wait! I put the wrong number in - I was reading a different field! I got it to return 1, which is correct.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:29:33 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107456#M764382</guid>
      <dc:creator>AlexC1256158230</dc:creator>
      <dc:date>2016-12-21T17:29:33Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107457#M764383</link>
      <description>&lt;P&gt;Can you run this and see what you get?&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_14823415897964090 jive_text_macro" data-renderedposition="50_8_932_144" jivemacro_uid="_14823415897964090"&gt;&lt;P&gt;var sys_id = '9391db4a0fb3a680ac50305be1050e9f';&lt;BR /&gt;var item_name = 'tra_amnt_given';&lt;BR /&gt;var item_value = '23'; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var gr = new GlideRecord('sc_item_option_mtom'); &amp;nbsp; &lt;BR /&gt;gr.addQuery('request_item',sys_id); &amp;nbsp; &lt;BR /&gt;//gr.addQuery('sc_item_option.item_option_new.name',item_name); &amp;nbsp; &lt;BR /&gt;//gr.addQuery('sc_item_option.value',item_value); &amp;nbsp; &lt;BR /&gt;gr.query(); &amp;nbsp; &lt;BR /&gt;gs.info(gr.getRowCount());&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;and&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 jive_text_macro _jivemacro_uid_14823415991582569" data-renderedposition="257_8_932_144" jivemacro_uid="_14823415991582569"&gt;&lt;P&gt;var sys_id = '9391db4a0fb3a680ac50305be1050e9f';&lt;BR /&gt;var item_name = 'tra_amnt_given';&lt;BR /&gt;var item_value = '23'; &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;var gr = new GlideRecord('sc_item_option_mtom'); &amp;nbsp; &lt;BR /&gt;gr.addQuery('request_item',sys_id); &amp;nbsp; &lt;BR /&gt;gr.addQuery('sc_item_option.item_option_new.name',item_name); &amp;nbsp; &lt;BR /&gt;//gr.addQuery('sc_item_option.value',item_value); &amp;nbsp; &lt;BR /&gt;gr.query(); &amp;nbsp; &lt;BR /&gt;gs.info(gr.getRowCount());&lt;/P&gt;&lt;BR /&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:33:38 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107457#M764383</guid>
      <dc:creator>drjohnchun</dc:creator>
      <dc:date>2016-12-21T17:33:38Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107458#M764384</link>
      <description>&lt;P&gt;for the first one I get &lt;/P&gt;&lt;BR /&gt;&lt;P&gt;*** Script: 93&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;and for the second one I get&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;*** Script: 1&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:36:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107458#M764384</guid>
      <dc:creator>AlexC1256158230</dc:creator>
      <dc:date>2016-12-21T17:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107459#M764385</link>
      <description>&lt;P&gt;So looks like you don't have the variable value of '23' for &lt;SPAN class="string"&gt;'tra_amnt_given'&lt;/SPAN&gt; in the sc_item_option table - can you confirm?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I also read &lt;A title="purbali" __default_attr="30567" __jive_macro_name="user" class="jive_macro jive_macro_user" data-orig-content="purbali" data-renderedposition="52.44999694824219_77.27999877929687_61_16" href="https://www.servicenow.com/community?id=community_user_profile&amp;amp;user=597e0a69dbd41fc09c9ffb651f961976"&gt;purbali&lt;/A&gt;'s comment and need to confirm what's triggering what change. Do you want&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;STRONG&gt;Changes to a variable value in sc_item_option will update a field value in sc_req_item&lt;/STRONG&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;If so, you need to have this BR in sc_item_option as &lt;A title="purbali" __default_attr="30567" __jive_macro_name="user" class="jive_macro jive_macro_user" data-orig-content="purbali" data-renderedposition="136.4499969482422_334.1600036621094_61_16" href="https://www.servicenow.com/community?id=community_user_profile&amp;amp;user=597e0a69dbd41fc09c9ffb651f961976"&gt;purbali&lt;/A&gt; said. Can you confirm?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:44:19 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107459#M764385</guid>
      <dc:creator>drjohnchun</dc:creator>
      <dc:date>2016-12-21T17:44:19Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107460#M764386</link>
      <description>&lt;P&gt;No, I do. That's why I thought the script was throwing back a value of one.&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;And I think so?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;What will happen is a user will input a request and one of the variables on the form (tra_amnt_given) will be left blank. Then a task will be assigned to Jane and while in that task, Jane will input a price in tra_amnt_given. After she has saved/closed the task, I want the value she put in that variable to populate a variable on the requested item table called u_tra_amnt.&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:59:11 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107460#M764386</guid>
      <dc:creator>AlexC1256158230</dc:creator>
      <dc:date>2016-12-21T17:59:11Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107461#M764387</link>
      <description>&lt;P&gt;Do you agree that the BR should be added to the &lt;STRONG&gt;sc_item_option&lt;/STRONG&gt; table and when the value of the &lt;STRONG&gt;tra_amnt_given&lt;/STRONG&gt; variable changes, the new value is written to the &lt;STRONG&gt;u_tra_amnt&lt;/STRONG&gt; field in the &lt;STRONG&gt;sc_req_item&lt;/STRONG&gt; table?&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;If so, you can still use the &lt;SPAN class="string"&gt;&lt;STRONG&gt;sc_item_option_mtom&lt;/STRONG&gt; table to locate the record to update in the &lt;STRONG&gt;sc_req_item&lt;/STRONG&gt; table you need to update.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;SPAN class="string"&gt;Please let me know if this is the case and how I may help.&lt;/SPAN&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Dec 2016 20:02:00 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107461#M764387</guid>
      <dc:creator>drjohnchun</dc:creator>
      <dc:date>2016-12-21T20:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Populating a Variable on sc_req_item table on update of catalog variable</title>
      <link>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107462#M764388</link>
      <description>&lt;P&gt;Hi Alex,&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;&lt;BR /&gt;&lt;P&gt;I have similar requirement. Did you get a solution to this?&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 03 Mar 2017 15:59:43 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/populating-a-variable-on-sc-req-item-table-on-update-of-catalog/m-p/2107462#M764388</guid>
      <dc:creator>SHA3</dc:creator>
      <dc:date>2017-03-03T15:59:43Z</dc:date>
    </item>
  </channel>
</rss>

