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
Dual Super User
Dual 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
Dual Super User
Dual 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.

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
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Users online (1,107)