<?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: Get values from MRVS in Developer forum</title>
    <link>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864587#M521513</link>
    <description>&lt;P&gt;hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="4a8abd3ddbcbcc1014d6fb2439961974"&gt;@Vaishnavi&lt;/SN-MENTION&gt; can you also help me i want to get a value from MRVS and set the value into other variable with comma separated using of catalog client script&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 15 Sep 2022 15:00:34 GMT</pubDate>
    <dc:creator>Aman66</dc:creator>
    <dc:date>2022-09-15T15:00:34Z</dc:date>
    <item>
      <title>Get values from MRVS</title>
      <link>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864581#M521507</link>
      <description>&lt;P&gt;Is there any way to get values from MRVS?&lt;BR /&gt;Specifically, I would like to have a record producer variable automatically populated with the result of a calculation based on the following MRVS values.&lt;BR /&gt;In the screenshot below, I want to multiply the "金額" and "課金単位数" and set the result of adding each to the "利用料金" variable.&lt;BR /&gt;In this screenshot, we see&lt;BR /&gt;In this screenshot, 500 x 1 + 600 x 2 = 1,700, so we need to set 1,700 to the "利用料金" variable.&lt;BR /&gt;Can I do it?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/46430i56A6D2D1BC017B8A/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 10:30:06 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864581#M521507</guid>
      <dc:creator>miyu</dc:creator>
      <dc:date>2022-02-02T10:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get values from MRVS</title>
      <link>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864582#M521508</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Please check below links almost same issue is resolved there:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://pathwayscg.com/accessing-multi-row-variable-sets-client-side-in-servicenow/"&gt;https://pathwayscg.com/accessing-multi-row-variable-sets-client-side-in-servicenow/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_article&amp;amp;sys_id=2a508caedbf47f48d82ffb243996198f"&gt;https://community.servicenow.com/community?id=community_article&amp;amp;sys_id=2a508caedbf47f48d82ffb243996198f&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Anil Lande&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 10:48:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864582#M521508</guid>
      <dc:creator>Anil Lande</dc:creator>
      <dc:date>2022-02-02T10:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get values from MRVS</title>
      <link>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864583#M521509</link>
      <description>&lt;P&gt;Hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="429c5789dbd4ec103daa1ea6689619ca"&gt;@miyu&lt;/SN-MENTION&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you try this:&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function onSubmit() {
    var count = 0;
    var mrvsData = g_form.getValue("u_request_data");  //replace with mrvs internal name
    var mrvsDatastr = JSON.parse(mrvsData);
    for (var i = 0; i &amp;lt; mrvsDatastr.length; i++) {
        count = count + parseInt(mrvsDatastr[i].u_data1) * parseInt(mrvsDatastr[i].u_data2);  //map your variable names
    }
    g_form.setValue("total_value", count);  //map variable name where you want to set
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Tested in my PDI&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/46428iD0997C8A8F9FABAD/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="find_real_file.png"&gt;&lt;img src="https://www.servicenow.com/community/image/serverpage/image-id/46437i411DCEFBD78FA1BD/image-size/large?v=v2&amp;amp;px=999" role="button" title="find_real_file.png" alt="find_real_file.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Hope it helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;Murthy&lt;/P&gt;</description>
      <pubDate>Wed, 02 Feb 2022 11:04:20 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864583#M521509</guid>
      <dc:creator>Murthy Ch</dc:creator>
      <dc:date>2022-02-02T11:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get values from MRVS</title>
      <link>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864584#M521510</link>
      <description>&lt;P&gt;Unfortunately, this isn't possble unless a new widget is created.&lt;/P&gt;
&lt;P&gt;There are events that will detect addition and modification of mrvs rows but there is no event to detect deletion of mrvs rows. So, deleting a row or selecting delete all can not be detected and the total will be wrong.&lt;/P&gt;
&lt;P&gt;The only way without developing a new widget is to create a button on the main form that will update the total when it is pushed.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 07:15:01 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864584#M521510</guid>
      <dc:creator>Hitoshi Ozawa</dc:creator>
      <dc:date>2022-02-03T07:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Get values from MRVS</title>
      <link>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864585#M521511</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;You can use this&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;var mrvs = current.variables.multirowvs;
var totalRows = mrvs.getRowCount();
var arr = [];

for (var i = 0; i &amp;lt; totalRows; i++) {
	var value = mrvs.getRow(i).getCell(',mrvs_col').getCellDisplayValue();
	arr.push(value.toString());
}

current.variables.mrvs_to_string = arr.toString();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Regards&lt;BR /&gt;Vaishnavi&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 07:17:18 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864585#M521511</guid>
      <dc:creator>Vaishnavi Lathk</dc:creator>
      <dc:date>2022-02-03T07:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Get values from MRVS</title>
      <link>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864586#M521512</link>
      <description>&lt;P&gt;Hi Miyu,&lt;/P&gt;
&lt;P&gt;Have a look at an article I wrote about MRVS here:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.servicenow.com/community?id=community_article&amp;amp;sys_id=f911162e1b6e1054d2ccea89bd4bcb53"&gt;https://community.servicenow.com/community?id=community_article&amp;amp;sys_id=f911162e1b6e1054d2ccea89bd4bcb53&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the comments I explain your use case to, from a MRVS value change, set a value on one of the main variables:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN class="ng-scope"&gt;On the Multi Row Variable Set use the following on an onChange script on the Variable you want as the trigger. In my case the employee_salary:&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;PRE class="language-javascript"&gt;&lt;CODE&gt;function onChange(control, oldValue, newValue, isLoading) {
	if (isLoading || newValue == '') {
		return;
	}
	if(parent.g_form){
        parent.g_form.setValue('salary', newValue);
    }
}&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in your case you should have an onChange for both the column that contains 500 and 600 as well as the 1 and 2. When you chage eiter of the values for those columns or add a new row you can update the total (in my code 'salary').&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps! Feel free to check out the Article and if it helped, please mark the article as helpful as well &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Feb 2022 08:41:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864586#M521512</guid>
      <dc:creator>Willem</dc:creator>
      <dc:date>2022-02-03T08:41:36Z</dc:date>
    </item>
    <item>
      <title>Re: Get values from MRVS</title>
      <link>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864587#M521513</link>
      <description>&lt;P&gt;hi &lt;SN-MENTION class="sn-mention" table="live_profile" sysid="4a8abd3ddbcbcc1014d6fb2439961974"&gt;@Vaishnavi&lt;/SN-MENTION&gt; can you also help me i want to get a value from MRVS and set the value into other variable with comma separated using of catalog client script&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Sep 2022 15:00:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/developer-forum/get-values-from-mrvs/m-p/1864587#M521513</guid>
      <dc:creator>Aman66</dc:creator>
      <dc:date>2022-09-15T15:00:34Z</dc:date>
    </item>
  </channel>
</rss>

