I'm trying to validate whether a list has an specific list of fields, it keeps returning all the existing fields from the list, how do I make this things work? Is there a better way to achieve what I'm trying?
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);
});