- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2019 03:34 AM
Hi Everyone,
Does anyone here already implemented a Copy button in MRVS? Just simply copying the above row.
Thanks,
Diane
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-17-2019 06:44 PM
Hi Diane,
I don't think there is a way to customize / modify the out of the box widget / section which renders the multi-row variable set. One option that you have is creating a UI Macro to read the last row entered in the MRVS and copy it to the next row.
You can refer to the answer in your other thread on how to set values to a MRVS using client script:
You can have client script in your UI Macro, to read the last line of the MRVS and add that as another line to it.
Sample Script:
//Considering the internal name of the multi row variable set is "mrvs"
//Get the array of variables
var mrvs = JSON.parse(g_form.getValue("mrvs"));
//Get the last row added
var lastRow = mrvs[mrvs.length-1];
//Copy that row as the next row
mrvs.push(lastRow);
g_form.setValue("mrvs", JSON.stringify(mrvs));
Hope this helps!
Cheers,
Manish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2019 08:03 AM
Hi Diane,
Thanks for the above. Thats working great in the normal UI. I would need this on the portal as well. I see that macros are not supported on the portal, how would I get this working there?
Thanks
Sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2019 09:13 AM
HI,
I worked out that I needed it as a widget to work on the portal. I'm pretty new to trying anything with widgets, but managed to get something working, but the button on the portal is the full width of the form:
My widget code is:
HTML:
<div>
<button type="button" class="btn btn-primary btn-block" ng-click="c.copyLastRow()">Copy Last Row
</button>
</div>
Client Script:
function($scope) {
/* widget controller */
var c = this;
c.copyLastRow = function(){
var g_form = $scope.page.g_form;
var mrvs = JSON.parse(g_form.getValue("activation"));
var lastRow = mrvs[mrvs.length-1];
mrvs.push(lastRow);
g_form.setValue("activation", JSON.stringify(mrvs));
}
}
Any help on how I can adjust the size of the button? Also how can I make the button greyed out and not usable until at least one row has been added to the MRV?
Thanks
Sam

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-25-2019 05:10 AM
Hi Sam,
You need to edit the CSS part of your widget. Like:
#my_button{
width: 20%;
}
And also put the matching id in your html :
<button type="button" id="my_button" class="btn btn-primary btn-block" ng-click="c.copyLastRow()">
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-30-2025 11:23 AM
Still can't believe this hasn't been added yet but great post, worked seamlessly!