Undefined field value on form submit

I’d like to capture a field value entered into a form upon submission, but I get an ‘undefined’ result instead of the actual data entered.

Here’s some similar code…

$(document).on(‘knack-form-submit.view_XX’, function(event, view, data) {
var value = data.field_123;
alert(value);
});

What am I doing wrong here, …any ideas?

Thanks in advance!

Figured it out!

Nothing wrong with the code… but I was referencing the wrong object since I was using the Account object and looking for a value in a different role.