form.</p>
<pre><code class="language-TypeScript">import { spfi } from &quot;@pnp/sp&quot;;
import &quot;@pnp/sp/webs&quot;;
import &quot;@pnp/sp/lists&quot;;
import &quot;@pnp/sp/fields&quot;;

const sp = spfi(...);

// show field called 'My Field' in edit form throughout web
await sp.web.fields.getByTitle(&quot;My Field&quot;).setShowInEditForm(true);
// show field called 'My Field' in edit form for list 'My List'
await sp.web.lists.getByTitle(&quot;My List&quot;).fields.getByTitle(&quot;My Field&quot;).se