0

In SPFx Webpart properties, as a cascading drop down showing all list/library from the current site, based on the selection of the list, trying to show the list fields.

var spListColumns = _sp.web.lists.getById(this.properties.listId).fields.filter( "ReadOnlyField eq false and Hidden eq false and TypeAsString eq 'Choice'" ).get();

It seems .get() is deprecated, no examples are shown in the pnp document guide to get all list fields in the @pnp/sp : 3.11.x version.

any other way to get all list fields

1 Answer 1

1

get() does not work in PnP version 3. Use just brackets like this ().

Refer below code:

let spListColumns = _sp.web.lists.getById(this.properties.listId).fields.filter( "ReadOnlyField eq false and Hidden eq false and TypeAsString eq 'Choice'" )();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.