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/long-term-retention.md
+33-10Lines changed: 33 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Long-term data retention
3
3
description: Learn how to use retention policies to transfer data from your Microsoft Dataverse transactional database to a managed data lake for cost-efficient long-term storage.
4
-
ms.date: 04/02/2024
4
+
ms.date: 06/27/2024
5
5
ms.topic: how-to
6
6
author: pnghub
7
7
ms.author: gned
@@ -18,6 +18,26 @@ ms.custom: bap-template
18
18
19
19
> [!IMPORTANT]
20
20
> To use all long term data retention features you must meet both of the requirements described here: [Dataverse long term data retention overview](../../maker/data-platform/data-retention-overview.md#dataverse-long-term-data-retention-overview).
21
+
22
+
23
+
## Retrieve retained data
24
+
25
+
You can retrieve data that has been retained using FetchXml and [QueryExpression ](/dotnet/api/microsoft.xrm.sdk.query.queryexpression).
26
+
27
+
With FetchXml, set the [fetch element](fetchxml/reference/fetch.md)`datasource` attribute value to `"retained"`.
28
+
29
+
```xml
30
+
<fetchdatasource="retained">
31
+
<entityname="account">
32
+
<attributename="accountId" />
33
+
</entity>
34
+
</fetch>
35
+
```
36
+
37
+
With [QueryExpression ](/dotnet/api/microsoft.xrm.sdk.query.queryexpression), set the [QueryExpression.DataSource property](/dotnet/api/microsoft.xrm.sdk.query.queryexpression.datasource) to `retained`.
38
+
39
+
> [!NOTE]
40
+
> There is currently no way to retrieve retained data using [Dataverse Web API](webapi/query-data-web-api.md).
21
41
22
42
## Set up a retention policy
23
43
@@ -37,7 +57,7 @@ public void CreateRetentionConfig(IOrganizationService orgService)
If you need to retrieve long term data from multiple related tables, such as the account table, which has an associated retained case table, first use advanced find retrieve the retained case row. Then use the `Casenumber` column and use advanced find to retrieve the account row that contains the case number.
40
44
41
45
More information: [Advanced find in model-driven apps](../../user/advanced-find.md)
42
46
43
-
## View retained data using using FetchXml
44
-
In order to fetch the retained data for a table, specify the `datasource="retained"` in the FetchXml.
More information: [Use FetchXml to retrieve data](/power-apps/developer/data-platform/fetchxml/retrieve-data?tabs=sdk)
56
-
57
47
## View retained data using a flow
58
48
59
49
Create a Power Automate cloud flow to create an Excel file of the retained data from a FetchXML query and send as an email attachment. More information: [Create a cloud flow to view Dataverse long term retained data](/power-automate/dataverse/data-retention-flow)
60
50
61
51
> [!NOTE]
62
52
> If the retained data includes attachments from the annotation table, the returned value is a base64 representation of the file. Large files might cause the cloud flow action to [time-out](/power-automate/limits-and-config#timeout) or to exceed its output [message size limit](/power-automate/limits-and-config#message-size).
63
53
>
64
-
> To workaround this behavior, use the Web API to perform the export action [ExportRetainedData](/power-apps/developer/data-platform/webapi/reference/exportretaineddata?view=dataverse-latest&preserve-view=true) using Azure Functions or other custom development options.
54
+
> To workaround this behavior, use the `ExportRetainedData` message Web API to [ExportRetainedData action](/power-apps/developer/data-platform/webapi/reference/exportretaineddata) or SDK for .NET using Azure Functions or other custom development options.
0 commit comments