Skip to content

Commit 70c47e9

Browse files
authored
Merge pull request #6177 from MicrosoftDocs/main
Refresh content on Web API query
2 parents ffa61ce + 5661097 commit 70c47e9

File tree

3 files changed

+4
-162
lines changed

3 files changed

+4
-162
lines changed

powerapps-docs/developer/data-platform/webapi/query-data-web-api.md

Lines changed: 1 addition & 156 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: "Query data using the Web API (Microsoft Dataverse)| Microsoft Docs"
33
description: "Read about the various ways to query Microsoft Dataverse table data using the Web API and the various system query options that can be applied in these queries."
4-
ms.date: 04/06/2022
4+
ms.date: 04/08/2022
55
author: divka78
66
ms.author: dikamath
77
ms.reviewer: jdaly
@@ -698,162 +698,7 @@ Preference-Applied: odata.include-annotations="*"
698698
}
699699
}
700700
```
701-
702-
<a name="bkmk_expandRelated"></a>
703-
704-
## Retrieve related tables by expanding navigation properties
705-
706-
<a name="bkmk_retrieverelatedentityexpandcollectionnavprop"></a>
707-
708-
### Retrieve related tables by expanding collection-valued navigation properties
709-
710-
If you expand on collection-valued navigation parameters to retrieve related entities for entity sets, an `@odata.nextLink` property will be returned for the related entities. You should use the value of the `@odata.nextLink` property with a new `GET` request to return the required data.
711-
712-
The following example retrieves the tasks assigned to the top 5 account records.
713-
714-
**Request**
715-
716-
```http
717-
GET [Organization URI]/api/data/v9.1/accounts?$top=5
718-
&$select=name
719-
&$expand=Account_Tasks($select=subject,scheduledstart) HTTP/1.1
720-
Accept: application/json
721-
OData-MaxVersion: 4.0
722-
OData-Version: 4.0
723-
```
724-
725-
**Response**
726-
727-
```http
728-
HTTP/1.1 200 OK
729-
Content-Type: application/json; odata.metadata=minimal
730-
OData-Version: 4.0
731-
732-
{
733-
"@odata.context":"[Organization URI]/api/data/v9.1/$metadata#accounts(name,Account_Tasks,Account_Tasks(subject,scheduledstart))",
734-
"value":[
735-
{
736-
"@odata.etag":"W/\"513475\"",
737-
"name":"Fourth Coffee (sample)",
738-
"accountid":"36dbf27c-8efb-e511-80d2-00155db07c77",
739-
"Account_Tasks":[
740-
741-
],
742-
"[email protected]":"[Organization URI]/api/data/v9.1/accounts(36dbf27c-8efb-e511-80d2-00155db07c77)/Account_Tasks?$select=subject,scheduledstart"
743-
},
744-
{
745-
"@odata.etag":"W/\"513477\"",
746-
"name":"Litware, Inc. (sample)",
747-
"accountid":"38dbf27c-8efb-e511-80d2-00155db07c77",
748-
"Account_Tasks":[
749-
750-
],
751-
"[email protected]":"[Organization URI]/api/data/v9.1/accounts(38dbf27c-8efb-e511-80d2-00155db07c77)/Account_Tasks?$select=subject,scheduledstart"
752-
},
753-
{
754-
"@odata.etag":"W/\"514074\"",
755-
"name":"Adventure Works (sample)",
756-
"accountid":"3adbf27c-8efb-e511-80d2-00155db07c77",
757-
"Account_Tasks":[
758-
759-
],
760-
"[email protected]":"[Organization URI]/api/data/v9.1/accounts(3adbf27c-8efb-e511-80d2-00155db07c77)/Account_Tasks?$select=subject,scheduledstart"
761-
},
762-
{
763-
"@odata.etag":"W/\"513481\"",
764-
"name":"Fabrikam, Inc. (sample)",
765-
"accountid":"3cdbf27c-8efb-e511-80d2-00155db07c77",
766-
"Account_Tasks":[
767-
768-
],
769-
"[email protected]":"[Organization URI]/api/data/v9.1/accounts(3cdbf27c-8efb-e511-80d2-00155db07c77)/Account_Tasks?$select=subject,scheduledstart"
770-
},
771-
{
772-
"@odata.etag":"W/\"514057\"",
773-
"name":"Blue Yonder Airlines (sample)",
774-
"accountid":"3edbf27c-8efb-e511-80d2-00155db07c77",
775-
"Account_Tasks":[
776-
777-
],
778-
"[email protected]":"[Organization URI]/api/data/v9.1/accounts(3edbf27c-8efb-e511-80d2-00155db07c77)/Account_Tasks?$select=subject,scheduledstart"
779-
}
780-
]
781-
}
782-
783-
```
784-
785-
<a name="bkmk_retrieverelatedentitysingleandcollectionnavprop"></a>
786-
787-
### Retrieve related rows (records) by expanding both single-valued and collection-valued navigation properties
788-
789-
The following example demonstrates how you can expand related rows (records) for entity sets using both single and collection-valued navigation properties. As explained earlier, expanding on collection-valued navigation properties to retrieve related entities for entity sets returns an `@odata.nextLink` property for the related entities. You should use the value of the `@odata.nextLink` property with a new `GET` request to return the required data.
790-
791-
In this example, we are retrieving the contact and tasks assigned to the top 3 accounts.
792-
793-
**Request**
794701

795-
```http
796-
GET [Organization URI]/api/data/v9.1/accounts?$top=3
797-
&$select=name
798-
&$expand=primarycontactid($select=contactid,fullname),Account_Tasks($select=subject,scheduledstart) HTTP/1.1
799-
Accept: application/json
800-
OData-MaxVersion: 4.0
801-
OData-Version: 4.0
802-
```
803-
804-
**Response**
805-
806-
```http
807-
HTTP/1.1 200 OK
808-
Content-Type: application/json; odata.metadata=minimal
809-
OData-Version: 4.0
810-
811-
{
812-
"@odata.context":"[Organization URI]/api/data/v9.1/$metadata#accounts(name,primarycontactid,Account_Tasks,primarycontactid(contactid,fullname),Account_Tasks(subject,scheduledstart))",
813-
"value":[
814-
{
815-
"@odata.etag":"W/\"550614\"",
816-
"name":"Fourth Coffee (sample)",
817-
"accountid":"5b9648c3-68f7-e511-80d3-00155db53318",
818-
"primarycontactid":{
819-
"contactid":"c19648c3-68f7-e511-80d3-00155db53318",
820-
"fullname":"Yvonne McKay (sample)"
821-
},
822-
"Account_Tasks":[
823-
824-
],
825-
"[email protected]":"[Organization URI]/api/data/v9.1/accounts(5b9648c3-68f7-e511-80d3-00155db53318)/Account_Tasks?$select=subject,scheduledstart"
826-
},
827-
{
828-
"@odata.etag":"W/\"550615\"",
829-
"name":"Litware, Inc. (sample)",
830-
"accountid":"5d9648c3-68f7-e511-80d3-00155db53318",
831-
"primarycontactid":{
832-
"contactid":"c39648c3-68f7-e511-80d3-00155db53318",
833-
"fullname":"Susanna Stubberod (sample)"
834-
},
835-
"Account_Tasks":[
836-
837-
],
838-
"[email protected]":"[Organization URI]/api/data/v9.1/accounts(5d9648c3-68f7-e511-80d3-00155db53318)/Account_Tasks?$select=subject,scheduledstart"
839-
},
840-
{
841-
"@odata.etag":"W/\"550616\"",
842-
"name":"Adventure Works (sample)",
843-
"accountid":"5f9648c3-68f7-e511-80d3-00155db53318",
844-
"primarycontactid":{
845-
"contactid":"c59648c3-68f7-e511-80d3-00155db53318",
846-
"fullname":"Nancy Anderson (sample)"
847-
},
848-
"Account_Tasks":[
849-
850-
],
851-
"[email protected]":"[Organization URI]/api/data/v9.1/accounts(5f9648c3-68f7-e511-80d3-00155db53318)/Account_Tasks?$select=subject,scheduledstart"
852-
}
853-
]
854-
}
855-
856-
```
857702
<a name="BKMK_changetracking"></a>
858703

859704
## Use change tracking to synchronize data with external systems

powerapps-docs/developer/data-platform/webapi/retrieve-entity-using-web-api.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ Use the `$expand` system query option to control what data from related entities
228228
If you simply include the name of the navigation property, you’ll receive all the properties for related records. You can limit the properties returned for related records using the `$select` system query option in parentheses after the navigation property name. Use this for both single-valued and collection-valued navigation properties.
229229

230230
> [!NOTE]
231-
> To retrieve related entities for entity sets, see [Retrieve related tables by expanding navigation properties](query-data-web-api.md#bkmk_expandRelated).
231+
> To retrieve related entities for entity sets, see [Retrieve related table records with a query](retrieve-related-entities-query.md).
232232
233233
- **Retrieve related entities for an entity instance by expanding single-valued navigation properties**: <br />The following example demonstrates how to retrieve the contact for an account entity. For the related contact record, we are only retrieving the contactid and fullname.
234234

@@ -331,9 +331,6 @@ If you simply include the name of the navigation property, you’ll receive all
331331
]
332332
}
333333
```
334-
335-
> [!NOTE]
336-
> 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](query-data-web-api.md#bkmk_expandRelated)
337334

338335
- **Retrieve related entities for an entity instance by expanding both single-valued and collection-valued navigation properties**: The following example demonstrates how you can expand related entities for an entity instance using both single- and collection-values navigation properties.
339336

powerapps-docs/developer/data-platform/webapi/web-api-query-data-sample.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ This sample is divided into the following principal sections, containing Web API
4040
|[Ordering results](#bkmk_orderresults)|[Order results](query-data-web-api.md#bkmk_order)<br /><br /> [Filter results](query-data-web-api.md#bkmk_filter)|
4141
|[Parameter alias](#bkmk_parameteralias)|[Use parameter aliases with system query options](query-data-web-api.md#bkmk_useParameterAliases)|
4242
|[Limit results](#bkmk_limitresults)|[Limit results](query-data-web-api.md#bkmk_limitResults)<br /><br /> [Limits on number of rows returned](query-data-web-api.md#bkmk_limits)|
43-
|[Expanding results](#bkmk_expandresults)|[Retrieve related rows by expanding navigation properties](query-data-web-api.md#bkmk_expandRelated)|
43+
|[Expanding results](#bkmk_expandresults)|[Retrieve related table records with a query](retrieve-related-entities-query.md)|
4444
|[Predefined queries](#bkmk_predefinedqueries)|[Retrieve and execute predefined queries](retrieve-and-execute-predefined-queries.md)<br /><br /> <xref:Microsoft.Dynamics.CRM.userquery?text=userquery EntityType/><br /><br /> <xref:Microsoft.Dynamics.CRM.savedquery?text=savedquery EntityType/>|
4545
<!-- TODO:
4646
|[FetchXML queries](#bkmk_fetchxml)|[FetchXML schema](../org-service/fetchxml-schema.md)<br /><br /> [Page large result sets with FetchXML](../org-service/page-large-result-sets-with-fetchxml.md)<br /><br /> [Use custom FetchXML](retrieve-and-execute-predefined-queries.md#bkmk_useFetchXML)| -->
@@ -1365,7 +1365,7 @@ Page 2 of 3:
13651365

13661366
## Expanding results
13671367

1368-
To retrieve information on associated table rows, use the `$expand` query option on navigation properties. More information:[Retrieve related rows by expanding navigation properties](query-data-web-api.md#bkmk_expandRelated).
1368+
To retrieve information on associated table rows, use the `$expand` query option on navigation properties. More information:[Retrieve related table records with a query](retrieve-related-entities-query.md)
13691369

13701370
### Expand on single-valued navigation property
13711371

0 commit comments

Comments
 (0)