site-field-to-a-list">Add a Site Field to a List<a class="headerlink" href="#add-a-site-field-to-a-list" title="Permanent link">&para;</a></h3>
<p>Use the createFieldAsXml method to add a site field to a list.</p>
<pre><code class="language-TypeScript">import { spfi } from &quot;@pnp/sp&quot;;
import { IFieldAddResult, FieldTypes } 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 n