CRM Crate

Restore Lost Data: Recover deleted table rows in Power Apps

In this blogpost, we will learn to recover and restore the deleted tables rows in Power Apps / Dynamics 365. Before diving in, ensure you’re subscribed to CRM Crate for the latest in Power Platform updates.

Restore Lost Data: Recover deleted table rows in Power Apps

In Power Apps / Dynamics 365, Dataverse is a secure and scalable data platform that allows you to store and manage business data used by your applications. Within Dataverse, tables and rows play a significant role:

  1. Tables: Tables in Dataverse are similar to tables in a relational database. They define the structure of your data by specifying columns and data types. You can create custom tables to store specific types of information relevant to your business processes. For example, you might have tables for customers, orders, products, employees, etc.
  2. Rows: Rows, also known as records or entities, represent individual instances of data within a table. Each row corresponds to a unique record in the table and contains values for each of the columns defined in that table. For instance, in a “Customers” table, each row could represent a different customer, with columns such as CustomerID, Name, Address, Contact Information, etc.

When you work with Dynamics 365 applications, you often interact with Dataverse tables and rows to store, retrieve, and manipulate data. These entities form the backbone of your data storage and management strategy within the Dynamics 365 ecosystem.

Restoring deleted tables and rows is an important feature in Dataverse (Dynamics 365) for several reasons:

  1. Data Recovery: Accidental deletions happen, whether it’s a table or a row within a table. Being able to restore deleted data allows businesses to recover critical information that might have been mistakenly removed. This helps in maintaining data integrity and ensures that important business data is not lost permanently.
  2. Compliance and Auditing: Many industries have regulatory requirements regarding data retention and audit trails. Having the ability to restore deleted tables and rows enables businesses to meet these compliance standards by providing a way to track changes to data and recover deleted information when necessary for audits or legal purposes.
  3. Avoiding Data Loss: Data loss can be detrimental to business operations, causing disruptions and potential financial losses. By having a backup and restore mechanism for tables and rows, organizations can mitigate the risks associated with data loss and ensure continuity in their processes.
  4. Recovering from Mistakes: Sometimes, data deletions are the result of human error or system glitches. Being able to restore deleted data allows administrators to rectify mistakes quickly and efficiently, minimizing the impact on business operations and preventing potential productivity losses.
  5. Historical Analysis: Restoring deleted rows can also be valuable for historical analysis and reporting. It allows organizations to reconstruct past states of data and analyze trends or patterns over time, providing valuable insights for decision-making and strategic planning.

Overall, the ability to restore deleted tables and rows in Dataverse is significant as it enhances data resilience, supports compliance requirements, reduces the impact of errors, and facilitates data-driven decision-making processes.


How to recover deleted table rows in Power Apps using Recycle bin?

Within Microsoft Dataverse’s routine business processes, users frequently delete records or transactions intentionally or inadvertently through various means such as system processes, individual selections, multiple selections, or bulk deletion. Recovering deleted data can be challenging, and records may not always be retrievable. To mitigate this issue, the recycle bin is provided to restore table record data from any deletion scenario within a customizable time frame.

Follow the bellow steps to enable recycle bin:

  1. Log in to the Power Platform admin center using admin credentials (Dynamics 365, Global, or Microsoft Power Platform admin).
  2. Navigate to Environments and open your desired environment.
  3. Go to Settings > Product > Features.
  4. Scroll down to access the Recycle Bin settings.
  5. Enable the Recycle Bin setting.
  6. Define the time interval for restoring table records. You can recover table records within 30 days of deletion.
Restore Lost Data: Recover deleted table rows in Power Apps

Access and recover deleted rows / records within Power Apps:

During the preview phase, only System Administrators have the ability to view and take action on deleted records within the Power Apps user interface.

  1. To access the Power Platform admin center, make sure you’re signed in as a user with the system administrator security role.
  2. Once you’re in, navigate to Environments and open the specific environment where you want to see and recover deleted records.
  3. Then, go to Settings > Data management > View Deleted Records.
  4. This will open a new tab where you can see all the deleted records across all tables.
  5. To restore or recover a table row or multiple rows, simply select them and then click on Restore in the command bar as shown below.
  6. Select “Ok” to confirm the action to restore.
Restore Lost Data: Recover deleted table rows in Power Apps

Tables unsupported for recycle bin (CRM Crate)

Tables unsupported for recycle bin (CRM Crate)



You can also use the following FetchXML query for detecting which tables don’t have recycle bin enabled:

<fetch>
<entity name='entity'>
<attribute name='logicalname' />
<filter type='or'>
<condition entityname='recyclebin'
attribute='extensionofrecordid'
operator='null' />
<condition entityname='recyclebin'
attribute='statecode'
operator='ne'
value='0' />
<condition entityname='recyclebin'
attribute='isreadyforrecyclebin'
operator='ne'
value='1' />
</filter>
<order attribute='logicalname' />
<link-entity name='recyclebinconfig'
from='extensionofrecordid'
to='entityid'
link-type='outer'
alias='recyclebin' />
</entity>
</fetch>

You can also use the following FetchXML query for detecting which tables have recycle bin enabled:

<fetch>
<entity name='recyclebinconfig'>
<filter type='and'>
<condition attribute='statecode'
operator='eq'
value='0' />
<condition attribute='isreadyforrecyclebin'
operator='eq'
value='1' />
</filter>
<link-entity name='entity'
from='entityid'
to='extensionofrecordid'
link-type='inner'
alias='entity'>
<attribute name='logicalname' />
<order attribute='logicalname' />
</link-entity>
</entity>
</fetch>

Restoring deleted table rows in Power Apps can offer significant benefits, enhancing data integrity and user experience. It allows for recovering valuable information, maintaining historical records, and ensuring accuracy in data analysis. Moreover, restoration capabilities empower users to rectify accidental deletions swiftly, thereby promoting efficiency and confidence in data management processes.


5 1 vote
Article Rating
Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
error: CRM Crate Security Engine - Disabled Right Click & Selection!

Congratulations!

Well Done,
Welcome to CRM Crate

Stay tuned with us and get all latest updates and learning in Microsoft CRM and related techonologes.