Skip to content

Commit faccdd5

Browse files
Live publish for 28 February 2024.
2 parents b010f60 + 13dcec3 commit faccdd5

File tree

5 files changed

+195
-11
lines changed

5 files changed

+195
-11
lines changed

powerapps-docs/developer/data-platform/create-elastic-tables.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Create elastic tables using code
33
description: Learn how to create Dataverse elastic tables with code.
44
ms.topic: article
5-
ms.date: 07/18/2023
5+
ms.date: 02/22/2024
66
author: pnghub
77
ms.author: gned
88
ms.reviewer: jdaly
@@ -11,6 +11,7 @@ search.audienceType:
1111
contributors:
1212
- sumantb-msft
1313
- JimDaly
14+
- bhavana95
1415
---
1516

1617
# Create elastic tables using code
@@ -319,10 +320,22 @@ One-to-many relationships are supported for elastic tables with the following li
319320
- Formatted values for lookup columns aren't returned when the following conditions are true:
320321

321322
- The table that is retrieved is a standard table, and the lookup refers to an elastic table.
322-
- You're using a custom elastic table `partitionid` value. In other words, the `partitionid` value is set to something other than the default value (the primary key value of the elastic table row). [Learn how to choose a partitionid value](elastic-tables.md#choosing-a-partitionid-value).
323+
- You're using a custom elastic table `partitionid` value. In other words, the `partitionid` value is set to something other than the default value (null). [Learn how to choose a partitionid value](elastic-tables.md#choosing-a-partitionid-value).
323324

324325
Elastic tables support one-to-many relationships, and related rows can be retrieved when a record is retrieved. Related records can't be included in a query. [Learn how to return related rows in a query](use-elastic-tables.md#return-related-rows-in-a-query).
325326

327+
### Partitionid value column on referencing table
328+
329+
When you create a many-to-one relationship on a table that refers to an elastic table, a lookup column is created on the referencing table as you would expect.
330+
331+
At the same time, a string column is created that follows this naming convention `<lookup name>pid`. This column stores the `partitionid` value for the related elastic table record.
332+
333+
The `<lookup name>pid` column value is set automatically when you use the elastic table alternate key to set the lookup column. [Learn to associate elastic table records](use-elastic-tables.md#associate-elastic-table-records)
334+
335+
If you are *not* using a partitioning strategy for your elastic table, the value for this `<lookup name>pid` column is null, and you shouldn't change it after the record is created.
336+
337+
If you *are* using a partitioning strategy for your elastic table, and you want to retrieve the related elastic table record, you can't rely on the value of the lookup column alone. You must also include the `partitionid` value from the `<lookup name>pid` column to uniquely identify the related table. [Learn more about partitioning and horizontal scaling](elastic-tables.md#partitioning-and-horizontal-scaling)
338+
326339
## Next steps
327340

328341
> [!div class="nextstepaction"]

powerapps-docs/developer/data-platform/use-elastic-tables.md

Lines changed: 173 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Use elastic tables using code
33
description: Learn how to perform data operations on Dataverse elastic tables using code.
44
ms.topic: how-to
5-
ms.date: 01/18/2024
5+
ms.date: 02/22/2024
66
author: pnghub
77
ms.author: gned
88
ms.reviewer: jdaly
@@ -11,6 +11,7 @@ search.audienceType:
1111
contributors:
1212
- sumantb-msft
1313
- JimDaly
14+
- bhavana95
1415
---
1516

1617
# Use elastic tables using code
@@ -84,6 +85,9 @@ MSCRM.SessionToken: 240:8#144100870#7=-1
8485

8586
As was mentioned in [Partitioning and horizontal scaling](elastic-tables.md#partitioning-and-horizontal-scaling), each elastic table has a `partitionid` column that you must use if you choose to apply a partitioning strategy for the table. Otherwise, don't set a value for the `partitionid` column.
8687

88+
> [!IMPORTANT]
89+
> If you choose to use a partitioning strategy for your elastic table, all operations on that table or referring to records in that table **MUST** specify the `partitionid` column value to uniquely identify the record. There is no error thrown if `partitionid` is not specified in the lookup value of referencing table, but the lookup will fail to locate the record when you use it. You must document and enforce this requirement via code reviews to ensure that your data is consistent and `partitionid` is used appropriately for all the operations.
90+
8791
After you specify a non-null value for the `partitionid` column when you create a row, you must specify it when you perform any other data operation on that row. You can't change the value later.
8892

8993
If you don't set a `partitionid` value for a record when you create it, the `partitionid` column value remains null, and you can't change it later. In this case, you can identify records by using the primary key, just as you do with standard tables. Specifying a `partitionid` value isn't required.
@@ -97,7 +101,7 @@ You can set the `partitionid` value in following ways when you perform various d
97101

98102
As was mentioned in [Alternate keys](create-elastic-tables.md#alternate-keys), every elastic table has an alternate key that is named `KeyForNoSqlEntityWithPKPartitionId`. This alternate key combines the primary key of the table with the `partitionid` column.
99103

100-
You can use this alternate key to specify the `partitionid` value when you use `Retrieve`, `Update`, or `Delete` operations.
104+
If you are using a partitioning strategy, you must specify an alternate key to specify the `partitionid` value when you use `Retrieve`, `Update`, or `Delete` operations, or when you set a lookup column for another table that refers to an elastic table record.
101105

102106
#### [SDK for .NET](#tab/sdk)
103107

@@ -680,6 +684,173 @@ You can also use the `partitionId` parameter:
680684

681685
---
682686

687+
## Associate elastic table records
688+
689+
When a table record refers to an elastic table record where the `partitionid` column value is null, you can associate a record in that table to a elastic table record just like standard records. Refer [SDK for .NET](org-service/entity-operations-associate-disassociate.md), or [the Web API](webapi/associate-disassociate-entities-using-web-api.md).
690+
691+
When a table record refers to an elastic table record which has `partitionid` column value set, you must include the `partitionid` column value of the elastic table record when you set the lookup column of the referencing table. You can do this by including the value as an alternate key.
692+
693+
As described in [Partitionid value column on referencing table](create-elastic-tables.md#partitionid-value-column-on-referencing-table), when a one-to-many relationship is created and the elastic table is the *referenced* table, a string column and a lookup column is created on the *referencing* table. The string column stores the `partitionid` value of the referenced elastic table record.
694+
695+
You can set both the lookup and the string column values with their respective values by:
696+
697+
- Using an alternate key reference to set only the lookup
698+
- Setting the two column values together in one update
699+
700+
How you do this depends on whether you are using the SDK for .NET or Web API
701+
702+
703+
#### [SDK for .NET](#tab/sdk)
704+
705+
This example associates an elastic `contoso_SensorData` table record with the specified ID and `partitionid` to an existing account record by setting the lookup column with an alternate key:
706+
707+
```csharp
708+
/// <summary>
709+
/// Demonstrates associate to elastic table operation.
710+
/// </summary>
711+
/// <param name="service">Authenticated client implementing the IOrganizationService interface</param>
712+
/// <param name="sensordataId">The unique identifier of the contoso_sensordata table.</param>
713+
/// <param name="deviceId">The deviceId. PartitionId of sensor data record.</param>
714+
/// <param name="accountId">The unique identifier of the account record to update.</param>
715+
public static void AssociateAccountAlternateKeyExample(
716+
IOrganizationService service,
717+
Guid sensordataId,
718+
string deviceId,
719+
Guid accountId)
720+
{
721+
var keys = new KeyAttributeCollection() {
722+
{ "contoso_sensordataid", sensordataId },
723+
{ "partitionid", deviceId }
724+
};
725+
726+
var sensorDataReference = new EntityReference("contoso_sensordata", keys);
727+
728+
Entity account = new("account", accountId)
729+
{
730+
Attributes =
731+
{
732+
{"contoso_sensordata", sensorDataReference}
733+
}
734+
};
735+
736+
service.Update(account);
737+
}
738+
```
739+
740+
This example does the same thing, but sets both of the columns together:
741+
742+
```csharp
743+
/// <summary>
744+
/// Demonstrates associate to elastic table operation.
745+
/// </summary>
746+
/// <param name="service">Authenticated client implementing the IOrganizationService interface</param>
747+
/// <param name="sensordataId">The unique identifier of the contoso_sensordata table.</param>
748+
/// <param name="deviceId">The deviceId. PartitionId of sensor data record.</param>
749+
/// <param name="deviceId">The unique identifier of the account record to update.</param>
750+
public static void AssociateAccountBothColumnsExample(
751+
IOrganizationService service,
752+
Guid sensordataId,
753+
string deviceId,
754+
Guid accountId)
755+
{
756+
Entity account = new("account", accountId) {
757+
Attributes =
758+
{
759+
{"contoso_sensordata", new EntityReference("contoso_sensordata", sensordataId)},
760+
{"contoso_sensordatapid", deviceId }
761+
}
762+
};
763+
764+
service.Update(account);
765+
}
766+
```
767+
768+
Finally, this example shows using the [AssociateRequest](xref:Microsoft.Xrm.Sdk.Messages.AssociateRequest) to associate a collection of `account` records to the same `contoso_SensorData` table record in one operation.
769+
770+
```csharp
771+
/// <summary>
772+
/// Demonstrates associating multiple accounts to a contoso_sensordata elastic table record
773+
/// </summary>
774+
/// <param name="service">Authenticated client implementing the IOrganizationService interface</param>
775+
/// <param name="sensordataId">The unique identifier of the contoso_sensordata table.</param>
776+
/// <param name="deviceId">The deviceId. PartitionId of sensor data record.</param>
777+
/// <param name="relatedEntities">A collection of references to account records to associate to the contoso_sensordata elastic table record</param>
778+
public static void AssociateMultipleElasticTableExample(
779+
IOrganizationService service,
780+
Guid sensordataId,
781+
string deviceId,
782+
EntityReferenceCollection relatedEntities)
783+
{
784+
785+
// The keys to the elastic table record including the partitionid
786+
var keys = new KeyAttributeCollection() {
787+
{ "contoso_sensordataid", sensordataId },
788+
{ "partitionid", deviceId }
789+
};
790+
791+
AssociateRequest request = new()
792+
{
793+
Target = new EntityReference("contoso_sensordata", keys),
794+
Relationship = new Relationship("contoso_SensorData_contoso_SensorData_Acc"),
795+
RelatedEntities = relatedEntities
796+
};
797+
798+
service.Execute(request);
799+
}
800+
```
801+
802+
803+
#### [Web API](#tab/webapi)
804+
805+
This example uses the alternate key style to associate a row of the `contoso_SensorData` table with `contoso_sensordataid` = `490c3c40-e8d1-ee11-9079-000d3a993550` and `partitionid` = `'DEVICE-123'` to account record with `accountid` value of `2ada33e7-ef8b-ee11-8179-000d3a9933c9`.
806+
807+
**Request:**
808+
809+
```http
810+
PATCH [Organization URI]/api/data/v9.2/accounts(2ada33e7-ef8b-ee11-8179-000d3a9933c9)
811+
Content-Type: application/json
812+
OData-MaxVersion: 4.0
813+
OData-Version: 4.0
814+
815+
{
816+
"[email protected]": "contoso_sensordatas(contoso_sensordataid=490c3c40-e8d1-ee11-9079-000d3a993550,partitionid='DEVICE-123')"
817+
}
818+
```
819+
820+
**Response:**
821+
822+
```http
823+
HTTP/1.1 204 No Content
824+
OData-Version: 4.0
825+
```
826+
827+
This example does the same thing, but sets both of the columns together:
828+
829+
**Request:**
830+
831+
```http
832+
PATCH [Organization URI]/api/data/v9.2/accounts(2ada33e7-ef8b-ee11-8179-000d3a9933c9)
833+
Content-Type: application/json
834+
OData-MaxVersion: 4.0
835+
OData-Version: 4.0
836+
837+
838+
{
839+
"contoso_sensordatapid": "DEVICE-123",
840+
"[email protected]": "contoso_sensordatas(490c3c40-e8d1-ee11-9079-000d3a993550)"
841+
}
842+
843+
```
844+
845+
**Response:**
846+
847+
```http
848+
HTTP/1.1 204 No Content
849+
OData-Version: 4.0
850+
```
851+
852+
---
853+
683854
## Bulk operations with elastic tables
684855

685856
Often, applications must ingest a large amount of data into Dataverse in a short time. Dataverse has a group of messages that are designed to achieve high throughput. With elastic tables, the throughput can be even higher.

powerapps-docs/maker/data-platform/azure-synapse-link-view-in-fabric.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Link to Microsoft Fabric from the Power Apps **Tables** area: Select **Analyze**
9898
5. If needed, the wizard asks you to create a one time connection to Microsoft Fabric within the same step. This connection is needed to enable Fabric and Dataverse services to securely access data. You need to sign in and then save the connection to proceed.
9999
6. The wizard asks you to select an existing Fabric workspace or to create a new one. You can expect to see shortcuts to all your tables within this workspace.
100100
7. If you don't see workspaces, ask the system to create a workspace. Go to [Troubleshooting common issues](#troubleshooting-common-issues) if you don't see the desired workspace.
101-
8. All Dataverse tables where "Change tracking" property is enabled are linked to Fabric. If this environment is linked to Finance Operations, you can add Finance and operations tables later. See [manage links section](## Manage link to Fabric).
101+
8. All Dataverse tables where "Change tracking" property is enabled are linked to Fabric. If this environment is linked to finance and operations apps, you can add finance and operations tables later. More information: [Manage link to Fabric](#manage-link-to-fabric).
102102
9. When done, select **Create** in the wizard to create the workspace, create shortcuts, and to perform the initialization for the first time.
103103
10. When complete, Fabric lakehouse opens in a separate browser tab.
104104

@@ -123,7 +123,7 @@ Admins can manage tables linked to OneLake from the **Azure Synapse Link for Dat
123123
5. When you add a table, the system performs an initial sync and indexes the data. When the initial sync is completed, a shortcut to OneLake is created. View the status of tables by selecting **Manage tables**.
124124

125125
> [!NOTE]
126-
> If your environment is linked to a Dynamics 365 finance and operations environment, the add tables option enables you to include tables from finance and operations apps. Learn more: (Choose finance and operations data in Azure Synapse Link for Dataverse)[azure-synapse-link-select-FnO-data.md]
126+
> If your environment is linked to a Dynamics 365 finance and operations environment, the add tables option enables you to include tables from finance and operations apps. Learn more: [Choose finance and operations data in Azure Synapse Link for Dataverse](azure-synapse-link-select-FnO-data.md)
127127
128128
6. When the sync status is **Active**, as data gets updated, your data changes are shown in reports created in Fabric.
129129
7. If a new column is added to a table that’s already added (also known as a metadata change), you can use the **Refresh Fabric tables** option to update the change in Fabric. You might need to review the report and downstream data flows to see that they aren't impacted by the change.

powerapps-docs/maker/data-platform/preferred-solution.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ You can delete your preferred solution or a preferred solution that other makers
5959

6060
- You can't set or view the preferred solution in the classic solution explorer.
6161
- Components that are created in the classic solution explorer won't go into the preferred solution.
62-
- Preferred solution currently doesn't work with cards, dataflows, AI Builder, chatbots, flows, connections, gateways, custom connectors, and canvas apps created from image or a figma design.
62+
- Preferred solution currently doesn't work with cards, dataflows, AI Builder, chatbots, connections, gateways, custom connectors, and canvas apps created from image or a figma design.
63+
- When a component is already part of an existing unmanaged solution, it will still be added to the preferred solution.
6364

6465
### See also
6566

powerapps-docs/maker/model-driven-apps/set-properties-chart-list-included-dashboard.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@
22
title: "Set properties for a model-driven app chart or list included in a dashboard in Power Apps | MicrosoftDocs"
33
description: "Learn how to set properties for chart or list included in a dashboard"
44
ms.custom: ""
5-
ms.date: 06/06/2018
5+
ms.date: 02/27/2024
66
ms.reviewer: ""
7-
87
ms.suite: ""
98
ms.tgt_pltfrm: ""
109
ms.topic: "conceptual"
@@ -48,11 +47,11 @@ search.audienceType:
4847

4948
- **Default View**. Select the view used to retrieve the data for the chart.
5049

51-
- **Default Chart**. Select the default chart that you want to display when the dashboard is first opened. The available values are determined by the value set for the Table property. This property works together with the Display Chart Selection property. A user can change the type of chart if the **Display Chart Selection** option is turned on, but the chart will revert to Default Chart the next time the dashboard is opened.
50+
- **Default Chart**. Select the default chart that you want to display when the dashboard is first opened. The available values are determined by the value set for the Table property. This property works together with the Display Chart Selection property. A user can change the chart displayed in the component if the **Display Chart Selection** option is turned on, but the chart will revert to Default Chart the next time the dashboard is opened.
5251

5352
- **Show Chart Only**. Select this check box if you want to display just the chart. Clear this check box if you want to display the chart and its associated data.
5453

55-
- **Display Chart Selection**. Select this check box to enable users to change the type of chart (column, bar, pie, etc.) when they use the dashboard. If the user changes the type of chart, the settings aren’t saved. The chart type reverts to the Default Chart setting when the dashboard is closed.
54+
- **Display Chart Selection**. Select this check box to enable users to change the chart displayed in the component at runtime. The component reverts to displaying the Default Chart next time the dashboard is opened.
5655

5756
1. You can set the following **list** properties from the **Set Properties** dialog box:
5857

0 commit comments

Comments
 (0)