You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: powerapps-docs/developer/data-platform/webapi/retrieve-entity-using-web-api.md
+50-26Lines changed: 50 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,10 @@
1
1
---
2
2
title: "Retrieve a table row using the Web API (Microsoft Dataverse)| Microsoft Docs"
3
3
description: "Read how to form a GET request using the Microsoft Dataverse Web API to retrieve table data specified as the resource with a unique identifier"
4
-
ms.date: 09/29/2022
4
+
ms.date: 01/29/2023
5
5
author: divkamath
6
6
ms.author: dikamath
7
7
ms.reviewer: jdaly
8
-
manager: sunilg
9
8
search.audienceType:
10
9
- developer
11
10
search.app:
@@ -31,7 +30,7 @@ Use a `GET` request to retrieve data for a record specified as the resource with
31
30
This example returns data for an account entity record with the primary key value equal to 00000000-0000-0000-0000-000000000001.
32
31
33
32
```http
34
-
GET [Organization URI]/api/data/v9.0/accounts(00000000-0000-0000-0000-000000000001)
33
+
GET [Organization URI]/api/data/v9.2/accounts(00000000-0000-0000-0000-000000000001)
35
34
```
36
35
37
36
To retrieve more than one entity record at a time, see [Basic query example](query-data-web-api.md#bkmk_basicQuery) in the [Query Data using the Web API](query-data-web-api.md) topic.
@@ -51,7 +50,7 @@ The following example retrieves `name` and `revenue` properties for the account
51
50
52
51
**Request**
53
52
```http
54
-
GET [Organization URI]/api/data/v9.0/accounts(00000000-0000-0000-0000-000000000001)?$select=name,revenue HTTP/1.1
53
+
GET [Organization URI]/api/data/v9.2/accounts(00000000-0000-0000-0000-000000000001)?$select=name,revenue HTTP/1.1
@@ -88,13 +87,13 @@ If you request a property that is part of a composite attribute for an address,
88
87
If an entity has an alternate key defined, you can also use the alternate key to retrieve the entity instead of the unique identifier for the entity. For example, if the `Contact` entity has an alternate key definition that includes both the `firstname` and `emailaddress1` properties, you can retrieve the contact using a query with data provided for those keys as shown here.
89
88
90
89
```http
91
-
GET [Organization URI]/api/data/v9.0/contacts(firstname='Joe',emailaddress1='[email protected]')
90
+
GET [Organization URI]/api/data/v9.2/contacts(firstname='Joe',emailaddress1='[email protected]')
92
91
```
93
92
94
93
If the alternate key definition contains lookup type field (for example, the `primarycontactid` property for the `account` entity), you can retrieve the `account` using the [Lookup properties](web-api-properties.md#lookup-properties) as shown here.
95
94
96
95
```http
97
-
GET [Organization URI]/api/data/v9.0/accounts(_primarycontactid_value=00000000-0000-0000-0000-000000000001)
96
+
GET [Organization URI]/api/data/v9.2/accounts(_primarycontactid_value=00000000-0000-0000-0000-000000000001)
98
97
```
99
98
100
99
Any time you need to uniquely identify an entity to retrieve, update, or delete, you can use alternate keys configured for the entity. By default, there are no alternate keys configured for entities. Alternate keys will only be available if the organization or a solution adds them.
@@ -116,7 +115,7 @@ This example returns only the value of the `name` property for an `account` enti
116
115
**Request**
117
116
118
117
```http
119
-
GET [Organization URI]/api/data/v9.0/accounts(00000000-0000-0000-0000-000000000001)/name HTTP/1.1
118
+
GET [Organization URI]/api/data/v9.2/accounts(00000000-0000-0000-0000-000000000001)/name HTTP/1.1
To retrieve the raw value of a primitive property rather than JSON, append `/$value` to the url.
139
+
140
+
**Request**
141
+
142
+
```http
143
+
GET [Organization URI]/api/data/v9.2/accounts(00000000-0000-0000-0000-000000000001)/name/$value HTTP/1.1
144
+
Accept: application/json
145
+
OData-MaxVersion: 4.0
146
+
OData-Version: 4.0
147
+
```
148
+
**Response**
149
+
150
+
```http
151
+
HTTP/1.1 200 OK
152
+
Content-Type: text/plain
153
+
OData-Version: 4.0
154
+
155
+
Adventure Works (sample)
156
+
```
157
+
158
+
> [!NOTE]
159
+
> Using the raw value is not common unless you are working with file or image data. More information: [Download a file in a single request using Web API](../file-column-data.md#download-a-file-in-a-single-request-using-web-api).
@@ -200,7 +224,7 @@ The following example returns the number of tasks related to a specific account
200
224
**Request**
201
225
202
226
```http
203
-
GET [Organization URI]/api/data/v9.0/accounts(00000000-0000-0000-0000-000000000001)/Account_Tasks/$count HTTP/1.1
227
+
GET [Organization URI]/api/data/v9.2/accounts(00000000-0000-0000-0000-000000000001)/Account_Tasks/$count HTTP/1.1
204
228
Accept: application/json
205
229
OData-MaxVersion: 4.0
206
230
OData-Version: 4.0
@@ -237,7 +261,7 @@ The following example demonstrates how to retrieve the contact for an account en
237
261
**Request**
238
262
239
263
```http
240
-
GET [Organization URI]/api/data/v9.0/accounts(00000000-0000-0000-0000-000000000001)?$select=name&$expand=primarycontactid($select=contactid,fullname) HTTP/1.1
264
+
GET [Organization URI]/api/data/v9.2/accounts(00000000-0000-0000-0000-000000000001)?$select=name&$expand=primarycontactid($select=contactid,fullname) HTTP/1.1
> Paging is not available for rows returned using `$expand` on collection-valued navigation properties. The maximum number of records returned is 5000. If you need paging, alter your query to return the collection you are expanding. For example, with the example above you could use the following URL with paging:
341
365
>
342
366
> ```http
343
-
> GET [Organization URI]/api/data/v9.0/accounts(915e89f5-29fc-e511-80d2-00155db07c77)/Account_Tasks?$select=subject,scheduledstart
367
+
> GET [Organization URI]/api/data/v9.2/accounts(915e89f5-29fc-e511-80d2-00155db07c77)/Account_Tasks?$select=subject,scheduledstart
344
368
> ```
345
369
>
346
370
> If you use nested `$expand` on collection-valued navigation properties, only the first level of data will be returned. Data for the second level will return an empty array. For example the following query:
@@ -386,7 +410,7 @@ The following example demonstrates how you can expand related entities for an en
386
410
**Request**
387
411
388
412
```http
389
-
GET [Organization URI]/api/data/v9.0/accounts(99390c24-9c72-e511-80d4-00155d2a68d1)?$select=accountid
413
+
GET [Organization URI]/api/data/v9.2/accounts(99390c24-9c72-e511-80d4-00155d2a68d1)?$select=accountid
0 commit comments