ew field called 'My Field' in web.
const field: IFieldAddResult = await sp.web.fields.add(&quot;My Field&quot;, FieldTypes.Text, { FieldTypeKind: 3, Group: &quot;My Group&quot; });
// add the site field 'My Field' to the list 'My List'
const r = await sp.web.lists.getByTitle(&quot;My List&quot;).fields.createFieldAsXml(field.data.SchemaXml as string);

// log the field Id to console
console.log(r.data.Id);
</code></pre>
<h3 id="add-a-text-field">Add a Text Field<a class="headerlink" href="#add-a-text-field"