Mode } from &quot;@pnp/sp/fields/types&quot;;
import &quot;@pnp/sp/webs&quot;;
import &quot;@pnp/sp/lists&quot;;
import &quot;@pnp/sp/fields&quot;;

const sp = spfi(...);

// create a new user field called 'My Field' in web
const field = await sp.web.fields.addUser(&quot;My Field&quot;, { SelectionMode: FieldUserSelectionMode.PeopleOnly, Group: &quot;My Group&quot; });
// create a new user field called 'My Field' in list 'My List'
const field2 = await sp.web.lists.getByTitle(&quot;My List&quot;).fields.addU