<?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 set outside variable value from inside client script of MVRS in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3523867#M1252893</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/382663"&gt;@Kalpesh Patil&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try using this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;g_service_catalog.parent.setValue('field','value');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;or&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;parent.setValue('field','value');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Apr 2026 09:24:34 GMT</pubDate>
    <dc:creator>Vishal Birajdar</dc:creator>
    <dc:date>2026-04-13T09:24:34Z</dc:date>
    <item>
      <title>How to set outside variable value from inside client script of MVRS</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3523850#M1252889</link>
      <description>&lt;DIV&gt;I am attempting to set the value of a variable outside a Multi‑Row Variable Set from a client script within the MRVS. However, this is not working.&lt;/DIV&gt;&lt;DIV&gt;&lt;BR /&gt;The requirement is to update an outside variable when a specific variable inside the MRVS changes.&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt; onChange(control, oldValue, newValue, isLoading) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (isLoading || newValue == &lt;/SPAN&gt;&lt;SPAN&gt;''&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;//g_form.setValue('in_domain', 'false');&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; email=g_form.getValue(&lt;/SPAN&gt;&lt;SPAN&gt;'u_email'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;alert(email);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; domain = email.split(&lt;/SPAN&gt;&lt;SPAN&gt;'@'&lt;/SPAN&gt;&lt;SPAN&gt;)[&lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;SPAN&gt;];&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;alert(domain);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; ga= &lt;/SPAN&gt;&lt;SPAN&gt;new&lt;/SPAN&gt; &lt;SPAN&gt;GlideAjax&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'getDomain'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;ga.addParam(&lt;/SPAN&gt;&lt;SPAN&gt;'sysparm_name'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'compareDomain'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;ga.addParam(&lt;/SPAN&gt;&lt;SPAN&gt;'sysparm_dom'&lt;/SPAN&gt;&lt;SPAN&gt;,domain);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ga.getXMLAnswer(&lt;/SPAN&gt;&lt;SPAN&gt;function&lt;/SPAN&gt;&lt;SPAN&gt; (response) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; alert(response);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt; (response !== &lt;/SPAN&gt;&lt;SPAN&gt;'true'&lt;/SPAN&gt;&lt;SPAN&gt;) {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(&lt;/SPAN&gt;&lt;SPAN&gt;'domain is not approved'&lt;/SPAN&gt;&lt;SPAN&gt;);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &lt;/SPAN&gt;&lt;SPAN&gt;else&lt;/SPAN&gt;&lt;SPAN&gt; {&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;alert(&lt;/SPAN&gt;&lt;SPAN&gt;'domain is &amp;nbsp;approved'&lt;/SPAN&gt;&lt;SPAN&gt;); // getting this alert&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g_form.setValue(&lt;/SPAN&gt;&lt;SPAN&gt;'in_domain'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;'true'&lt;/SPAN&gt;&lt;SPAN&gt;); // This is outside variable&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; });&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;//Type appropriate comment here, and begin script below&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 13 Apr 2026 09:11:31 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3523850#M1252889</guid>
      <dc:creator>Kalpesh Patil</dc:creator>
      <dc:date>2026-04-13T09:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to set outside variable value from inside client script of MVRS</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3523867#M1252893</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/382663"&gt;@Kalpesh Patil&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try using this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;g_service_catalog.parent.setValue('field','value');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;or&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;parent.setValue('field','value');&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2026 09:24:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3523867#M1252893</guid>
      <dc:creator>Vishal Birajdar</dc:creator>
      <dc:date>2026-04-13T09:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to set outside variable value from inside client script of MVRS</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3523878#M1252899</link>
      <description>&lt;P&gt;Hello Vishal,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your quick response.&lt;/P&gt;&lt;P&gt;Unfortunately, it's not working&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2026 09:32:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3523878#M1252899</guid>
      <dc:creator>Kalpesh Patil</dc:creator>
      <dc:date>2026-04-13T09:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to set outside variable value from inside client script of MVRS</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3523921#M1252914</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/382663"&gt;@Kalpesh Patil&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you want this for native or portal?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2026 10:14:30 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3523921#M1252914</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-04-13T10:14:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to set outside variable value from inside client script of MVRS</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3524028#M1252946</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/265966"&gt;@Ankur Bawiskar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want this on portal&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2026 12:37:27 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3524028#M1252946</guid>
      <dc:creator>Kalpesh Patil</dc:creator>
      <dc:date>2026-04-13T12:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to set outside variable value from inside client script of MVRS</title>
      <link>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3524042#M1252949</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/382663"&gt;@Kalpesh Patil&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I believe you can access outside variable within MRVS client script but not set it&lt;/P&gt;
&lt;P&gt;you can check if row is added/removed and then based on that handle the logic to set outside variable&lt;/P&gt;
&lt;P&gt;check this&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.servicenow.com/community/developer-forum/mrvs-detect-when-a-row-is-removed-or-deleted/m-p/1624263" target="_blank" rel="noopener"&gt;MRVS detect when a row is removed or deleted&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2026 12:54:40 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/how-to-set-outside-variable-value-from-inside-client-script-of/m-p/3524042#M1252949</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-04-13T12:54:40Z</dc:date>
    </item>
  </channel>
</rss>

