Elastic Tables: A New Power Apps Feature
- Najm-us-saher Farooque
- Sep 21, 2023
- 4 min read
People familiar with Power Apps are aware of its various table types, including standard, activity, and virtual tables. However, Microsoft has recently introduced a groundbreaking addition called Elastic Tables. It's worth noting that this feature is currently in preview, and Microsoft may roll out additional functionalities for Elastic Tables in the coming updates. In this blog post, we will delve into the practical applications and benefits of this remarkable feature.
Introduction of Elastic Tables:
Elastic tables have the same features and API as standard tables, but they have their own unique features because they use Azure Cosmos DB. What is Cosmos DB? It is a fully managed NoSQL and relational database for modern app development. It is used to build highly scalable and reliable applications. If you want to learn more about Azure Cosmos DB, you can refer to this documentation from Microsoft. https://learn.microsoft.com/en-us/azure/cosmos-db/introduction
Because Elastic Tables uses Azure Cosmos DB, this is why they can handle large volumes of data. Elastic tables have unique capabilities for flexible schema, horizontal scaling, and automatic removal of data after a time period. When a company aims to generate a substantial volume of data that needs to be automatically deleted after a set timeframe, Elastic Tables become a valuable solution. You can create a relation between Standard tables and Elastic Tables and since they are isolated from Standard tables so overall performance of the application will not be affected.
Users can use CreateMultiple, UpdateMultiple, and DeleteMultiple, to achieve more throughput within the Dataverse throttling limit.
Let's now explore how to create them within Power Apps.
Open Power Apps, Go to your Solution, Create Table, and Select Type Elastic Tables

There are certain settings not available for Elastic tables, like integrating with activity, duplicate detection, integrating with Connections, etc

When you Save the table, you will see there are two columns created for this table. Partition ID and Time to Live. These two are very important columns in the Elastic Tables
Time to Live will determine how long the record created for the table will be available in the system. It takes data in seconds. If no value is provided then the record will remain in the database same as the Standard Table
In Azure Cosmos DB, rows are divided into logical subsets using partition ID for every column. This means in this scenario if we are adding data of different types of coupons then we can add coupon type as Partition ID, in this way querying the data by Partition ID will be much faster as compared to querying data by other columns.
The Partition ID column can be modified initially. However, once a row is created with a specific Partition ID value, it becomes immutable. If you omit setting a Partition ID value for a row initially, it will remain null, and any later modifications to it will be restricted.

I have created a record in the Coupon Table with Time to live as 30 seconds. After 30 seconds this record will be expired from the database.


Creating Lookup in Elastic Tables:
You cannot create a lookup directly in the Elastic tables, You need to create the 1-N relationship with cascading None, which means there would be no reflection on related records if the parent record is deleted. If the elastic table record is deleted then related records should not deleted.
If we create a lookup directly then we will get into the error mentioned below

To create the lookup, we need to add a relationship
Navigate to your table (in this instance, Coupons) and proceed to Relationship. Create a new relationship with a One-to-Many association.
Point to be noted that the Many-to-Many relationship is not supported in the Elastic Tables

Create the relationship -> One-to-Many Relationship with Account
Here you can see Casacading is by default set to None

Here I have created a One-To-Many Relationship between Coupons and Accounts, so I would be able to see related Accounts in the Coupons Form

Data Retrieval:
For Data Retrieval in Elastic Table, you can retrieve it by the same Retrieve Method but you need the Partition ID to retrieve the record. If you use it without the Partition ID then you will get an error.
Bulk Operations:
Bulk Operations are very fast in the elastic tables, as compared to standard tables. As they execute in a single request. Some bulk operations are
CreateMultiple
UpdateMultiple
DeleteMultiple: This is only available for elastic tables.
As per Microsoft Documentation, Upsert Multiple is also coming soon.
Here are some key points and Limitations of Elastic Tables
You cannot use the Many-To-Many relationship in Elastic Table.
A one-to-many relationship is supported with the limitation that Cascading behavior should be set to Null
If you have any plugins registered on the elastic tables, in case of an error there is no roll-back. Records that are created or updated will be updated in the Dataverse.
While querying data with FetchXML, some features are not available like <link-entity>
The choice between Elastic tables and Standard tables in terms of usage relies on the specific application requirements. If you prioritize data consistency and relational tables, Standard tables are the way to go. On the other hand, if you need a standalone database structure, handle a high volume of data with frequent read and write operations, require scalability, or don't need to perform joins with other tables, Elastic tables offer significant advantages.
In our upcoming blog, we will delve into executing Retrieve, Create, and Update requests on Elastic tables, as well as mastering the querying process.
Stay tuned for the next blog!
Comments