yTitle(&quot;My List&quot;).fields.addLookup(&quot;My Field&quot;, { LookupListId: list.Id, LookupFieldName: &quot;Title&quot; });
const fieldDep2 = await sp.web.lists.getByTitle(&quot;My List&quot;).fields.addDependentLookupField(&quot;My Dep Field&quot;, field2.data.Id as string, &quot;Description&quot;);

// we can use this 'fieldDep' variable to run more queries on the field:
const r = await fieldDep.field.select(&quot;Id&quot;)();

// log the field Id to console
console.log(r.Id);
</code></pre>
<h3 id=