Here I am referring to the link:- https://github.com/dreamfactorysoftware/dsp-core/wiki/API-Access-via-Scripts
// Retrieve all contacts from the Contacts database
var _records = platform.api.get( "db/Contacts" );
// Uppercase each name...
_.each( _records, function( record ) {
record.name = record.name.toUpperCase();
});
The Above code does not work as expected, as the record.name seems to be undefined. The way to access the records seems to be working this way:-
_.each( _records, function( record ) {
print (“record is” + JSON.stringify(record));
print (“first is” + record[0].name);
}
So, the record is actually an array, which needs an index. _each as expected is not pointing to each record of the array, and record is still pointing to the array.
Please let me know which is correct. Is it a bug, or Wiki is defined incorectly.