I'm very new to ServiceNow so sorry if this is an obvious question. But I've checked the docs and haven't found a way to do this.
In my ServerScript I query to get a record from a table, and then to send that to the ClientScript I get the record values (this is the problem) and then add that obj to the data
obj.
Is there a way to get all of the records fields without listing them all? Similar to sql Select * ...
?
...
var userGR = new GlideRecord('sys_user');
gs.info(gs.getUser());
userGR.addQuery('user_name', gs.getUser().getName());
userGR.query();
while(userGR.next()){
var userObj = {};
$sp.getRecordValues(userObj, userGR, 'user_name');
data.users.push(userObj);
}
...
I want to do something like $sp.getRecordValues(userObj, userGR, '*');
in order to get all the columns in that table.
I'm thinking it's not natively possible, to try and prevent unnecessary data being sent. But just curious if there is a way?