cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GarryPope
Impactful Individual
Impactful Individual

Dataverse for Teams - Handling Duplicates In Canvas Apps

Hello Power Platform Community,

I hope you can help please. I have a question about how people are dealing with duplicates in Dataverse for Teams, as I don't believe it has duplicate detection rules like Dataverse does.


I have a Canvas App sitting on top of Dataverse for Teams. 

On my child table "Metrics", I have two columns:

  • Platform Team (which is a lookup column to the parent table called, "Platform Team")
  • Metrics Date (which is a Date and Time column)

If the user changes the value in Platform Team and the value Metrics Date to values that exist already on a record in my table "Metrics",

then I want to disable the save button and offer a notify message telling the user the record is a duplicate.

 

Example:

So a user is creating or editing a record.

In the column "Platform Team" a user adds "Dynamics"

In the "Metrics Date" a user adds "31/07/2021"

The app will throw an error and disable the save button as there is already a record in the database which has "Platform Team" = "Dynamics" and "Metrics Date" = "31/07/2021".

 

Any thoughts would be greatly appreciated.

Thanks very much,

Garry

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisPiasecki
Super User
Super User

Hi @GarryPope,

 

You can leverage CountRows and Filter to look for an existing record that matches the values. You would run this formula whenever the value changes in either of those 2 fields. 

Example:

 

If(CountRows(Filter(DataSource,"Platform Team" = "Value1" && "Metrics Date" = "Date1")) > 0,"Exist","Does Not Exist")

 

You can set this to a boolean variable and use that variable to to enable/disable the button and show/clear an error notification 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

View solution in original post

3 REPLIES 3
ChrisPiasecki
Super User
Super User

Hi @GarryPope,

 

You can leverage CountRows and Filter to look for an existing record that matches the values. You would run this formula whenever the value changes in either of those 2 fields. 

Example:

 

If(CountRows(Filter(DataSource,"Platform Team" = "Value1" && "Metrics Date" = "Date1")) > 0,"Exist","Does Not Exist")

 

You can set this to a boolean variable and use that variable to to enable/disable the button and show/clear an error notification 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

View solution in original post

Hello @ChrisPiasecki,

Thanks so much for the reply. This is great. May I please ask a follow up question?


I did try doing that last night, but found that I was then unable to edit the newly created record. 

So once it was created the record saved on the database, all good there, but if I'd made a mistake and wanted to edit the record it would not allow me to do it, as it kept saying, of course, the record is a duplicate because it does exist. 

 

Any idea how I'd get around the edit issue so it allows me to edit existing records?

Thanks so much,

Garry 

You can open that record by navigating to make.powerapps.com and select your table and select record and if it shows as read only then install Level up extension in Chrome browser and select option of God mode and you can edit the existing record.

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,007)