I have created following Entity:
When creating this Entity, I defined RecId as being the Primary Key.
I then use a Data Integration project from D365FO to CDS to populate this Entity
Customeraccount is a unique identifier of a customer.
Problem is than every time I run the integration project, It add new lines. as I a result, I get duplicate customers in my table.
When exploring further, I found something a bit weird in my entity definition (see below). I would have expected my RecId field to be set a Primary Key.
I tried creating again the entity, but it always create a Primary key field different than the one I set in the Entity creation form
Please advise if/what I am doing something wrong
Thank and Regards
Primary Field that you are showing is NOT a primary key. https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/data-platform-create-entity - CDS automatically creates a primary key of type GUID for every entity created in CDS.
"By default, every entity contains a Primary Field, which is used by lookup fields when establishing relationships with other entities. Typically the primary field stores the name or primary description of the data stored in the entity. You may update the name and display name of the primary field before saving the entity for the first time."
HI @sang73 ,
Do you want the RectId field not be populated with duplicated values in your Entity?
Based on the issue that you mentioned, I think you have some misunderstading on Primary Field in CDS Entity.
When you create a CDS Entity, it would auto-generate a Primary Field (in default, it is 'Primary Name' field) within your Entity. The Primary Filed in CDS Entity is a Required field rather than a Primary Key field, the Primary Key field (Unique Identifier field) would be generated by Entity itself.
Within your CDS Entity, the Primary Key field (Unique Identifier field) should be D365FO Customer. Within your CDS Entity, the Primary Key field should be similar as below:
Note: In default, the Primary Key (unique identifier) field should be has same name as your Entity.
As an alternative solution, within your Fields Mapping panel in your Data Integration project, please click "Advanved Query and Filtering" option to open Power Query panel:
Within the opened Power Query panel, select the Column field (of your D365 FO table) you want to import into the RectId field of your CDS Entity, then click "Reduce Rows"-> "Remove Duplicates" option to remove the duplcaited records from the source column from your D365 FO Table:
after that, click "OK" button, and save your Data Integration Project.
thanks for your clarification about Primary field. I confused it with Primary key
that being said, how to create a proxy of my D365FO table that is being "updated" on regular basis ?
when I call my data integration project several time, it insert new records instead of updating the existing records.
looking for your insights
Check out these cool Power Apps & vote on your favorite!
Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)
Check out whats happening in Power Apps
FIll out a quick form to claim your community user group member badge today!