Adding fields to the default view of a newly created list using PnP JS

Iron Contributor

I'm working on an SPFx web part that allows a user to click a button and create a list with a pre-defined structure. So far I have the list creation and field addition to the list working well.  The problem is that the newly added fields are not made part of the default view of the list.  On the SP UI, it's a simple check box on the field creation page -- how do I do this in PnP JS?  Nothing I've yet tried seems to work, and the View object returned by pnp.js.web.getbyname(name).defaultview().get() does not have a ViewFields collection for me to modify.  Any suggestions?

 

0 Replies