0

I have created a SharePoint list column using following PNP JS command as below,

return pnp.sp.web.lists.getByTitle(this.assessmentHistoryListName).fields.addMultilineText("Favorite", 6, true, false, false, true, { Group: "Custom Columns", Hidden: false });

I have added custom property {Group: "Custom Column", Hidden: false}

Still I can't see column in my SharePoint default list view.

Please refer this screenshot. [1]: https://i.stack.imgur.com/WWo4W.png

Dhrumil shah
  • 611
  • 4
  • 23

1 Answers1

0

You could use pnp js add the column to the default view in the then function:

sp.web.lists.getByTitle("testa").fields.add("testfield", "SP.FieldText", { FieldTypeKind: 3, Group: "My Group" }).then(res=>sp.web.lists.getByTitle("testa").defaultView.fields.add("testfield"));

References: add column to view

Amos
  • 2,030
  • 1
  • 5
  • 9