I have been attempting to validate a list to check for specific fields, but instead of returning only the specified fields, it is returning all existing fields. How can I make this work correctly? Are there any alternative methods that may be more effective?
sp.web.lists.getByTitle("SliceBox").fields.select("Title","Body","Link","Picture","Visible").get()
.then( (fields: any[]) => {
console.log("> number of fields returned:", fields.length);
fields.forEach(f => {
console.log("> field:", f);
})
})
.catch( err => {
console.log("> fields failure: ", err);
});