How to stop DataTable values from automatically changing

Hello,
Please see attached video and pay attention to what happens to the "Verified By" column. That column is set to populate the current user whenever a new item is created, but when a different user touches anywhere on another persons line, then clicks New Record is overrides the previous users name with the current users name.

Is there a way to "lock" the column so the Verified By user name doesn't change?

Hello @ParAvion,

Most likely, you need to update the code to avoid field change if it already has a value.

Please share the complete code that you are using, so I could help with corrections.

Here's the DataTable code:

fd.spRendered(function() {

fd.control('DataTable4').$on('change',

function(e) {

    var username = _spPageContextInfo.userDisplayName;

    fd.control('DataTable4').value[0].Column3 = username;

});

});

@ParAvion,

You can add the condition in the code to check if the column is blank and set the value, otherwise - do nothing.

fd.spRendered(function() {

	fd.control('DataTable4').$on('change', function(e) {
        if(!fd.control('DataTable4').value[0].Column3) {
              var username = _spPageContextInfo.userDisplayName;

              fd.control('DataTable4').value[0].Column3 = username;
        }
    });

});