title: Microsoft Dynamics 365 API How to Retrieve data from 2 custom entities with foreign key?
body: <p>I have 2 custom entities (linked together with a foreign key) in Microsoft dynamics CRM and i would like to retrieve data with the API using POSTMAN</p>
  <pre><code>society/api/data/v9.1/entity1?$select=data1,data2,data3&amp;$expand=foreignkeyentity2
  </code></pre>
  <p>My GET request works but I have a <code>@odata.nextLink</code> response instead of the foreign key values</p>
  <p>I saw in the Microsoft docs a note that said:</p>
  <p><em>If you expand on collection-valued navigation parameters to retrieve related entities for entity sets, a @odata.nextLink property will be returned instead for the related entities. You should use the value of the @odata.nextLink property with a new GET request to return the required data. More information:Retrieve related tables by expanding navigation properties</em></p>
  <p><a href="https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/query-data-web-api#bkmk_expandRelated" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/query-data-web-api#bkmk_expandRelated</a></p>
  <p>But when I follow the instructions from the docs, I get another <code>@odata.context</code> value which leads me to a 50000000 line page with values I don't understand</p>