cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Question regarding dataflows and alternate keys

Hi -

I need clarification on updating records in CDS using dataflow. Think made bad choice for the primary field of my entity.

 

The values of my primary field will change values with updates via dataflow over time. I have added and additional field "work item" which has unique values and set an alternate key to this field to ensure uniqueness. This new field is also used as key for field mapping of dataflow to CDS and I set a duplication check rule. Was running a dataflow where the primary field changed values and received the following error message.

 

Reason: Precondition Failed, Error code: 0x80060892, Message: A record that has the attribute values Work Item already exists. The entity key Work Item requires that this set of attributes contains unique values. Select unique values and try again.

 

Seems as if CDS tried to create a new record rather than updating the existing one . Is the primary field considered along with the new "work item" field to decide if a record is updated vs. new record created? If yes, do I need to set-up my custom entity again or is there a workaround?

 

Thanks in advance.

4 REPLIES 4
Super User III
Super User III

Upserts in data flows use alternate keys for matching. If the key is changed then it will not be able to update the record.

 

if you have changing keys you might want to consider a different integration tool. Even power automate can be used to handle more complex matching logic

 

a common design pattern is to use a staging table in azure sql and store the GUIDS of the cds records in it, then as your values change in the source update the staging table. That way you can then match precisely based on the Id of the record in cds when something changes

 

this approach works with power automate, logic apps, SSIS, to name a few 

@jlindstrom Thanks for confirming. Will try out power automate then, since the primary field is changing. Have a nice day.

@jlindstrom power automate does not like my Excel workbook that I worked well for the data flow. It connects to a web data source and I am using Power query to transform the data as needed for CDS upload.

When using "List rows present in a table", Power automate does not detect any tables (although formatted as table). No dynamic data available....

Would work it I copy values to a new workbook and format as table but then I am losing the refresh and data transformation.

Any ideas? Thxs in advance!

The issue appears to be a XML-Map that I used in my workbook. This feature is not supported in Excel for web. Tried another workbook with a power query and web resource, which works fine. Any alternative approaches how I could use the XML data source with power automate?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Users online (8,861)