How to Disable the “Add” Button in ServiceNow MRVS (Multi-Row Variable Set)
If you’ve worked with Multi-Row Variable Sets (MRVS) in ServiceNow, you’ve probably seen this requirement come up: “Allow users to add rows sometimes… but rest...
Let’s be honest…
Service Portal debugging is slow.
Every small change =
👉 Update script
👉 Save
👉 Reload
👉 Navigate back
👉 Test again
Repeat that 10 times and you’ve already lost 20 minutes.
So here’s a simple trick I use all the time to instantly set any field value inside a widget without changing code.
Instead of modifying your widget or backend, you can:
👉 Directly update the Angular scope
👉 Inject any value you want
👉 Instantly see UI changes
No reload. No deployment.
Open DevTools → Inspect the element → Select the field you want to set value → Run this:
var scope = angular.element($0).scope();
scope.$apply(function () {
scope.<object>.<field> = 'YOUR_TEMP_VALUE';
});var scope = angular.element($0).scope();
scope.$apply(function () {
scope.data.user_id = '12345';
});Replace:
<object> → Where your data lives (data, c, child, etc.)<field> → The field you want to modifyCommon patterns:
// Client controller style
scope.c.data.status = 'approved';
// Server data
scope.data.short_description = 'Test value';
// Nested object
scope.item.details.name = 'Sample';This is where most people struggle.
👉 After selecting element in DevTools:
var scope = angular.element($0).scope();
console.log(scope);
Now explore:
scope.datascope.cscope.itemscope.optionsYou’ll quickly find your target field.
$apply() → otherwise UI won’t refreshYou can:
✔ Test UI conditions instantly
✔ Simulate different states
✔ Debug visibility issues
✔ Avoid constant reloads
✔ Move faster during development
Sometimes the object doesn’t exist yet.
Use this safer version:
var scope = angular.element($0).scope();
scope.$apply(function () {
scope.data = scope.data || {};
scope.data.test_field = 'VALUE';
});I personally use this for:
This is not something you’ll find in official docs.
But once you start using it,
👉 you’ll never debug widgets the same way again.
Written by
If you’ve worked with Multi-Row Variable Sets (MRVS) in ServiceNow, you’ve probably seen this requirement come up: “Allow users to add rows sometimes… but rest...
Learn how to embed the ServiceNow Virtual Agent in any website using the Portable Web Client, with support for SSO, CORS, and custom branding. Includes code sam...
💡Specific record operations? GlideRecord Aggregated data and calculations? GlideAggregate If you're anything like me you must have spent a fairbit of time s...