Duplication method 2 are not working properly

hi dears,

I followed all the steps on this page to minimize duplication when data entries register new beneficiaries : https://confluence.dimagi.com/display/commcarepublic/Minimize+Duplicates+Method+2%3A+Validating+from+a+Label
this method was working for a while with me, but later stopped alerting data entries about the duplication, i tried all my best to check why it is not working i didn`t find a solution until lately i figured this message on the website : ( Warning!
Please note the following limitations:

1- Troubleshooting for this method is not actively supported by the CommCare Support Team.
2- You must test this feature on mobile, not app preview or web apps. ).

any help or support from your side, i would be appreciate it.

guys anyone have an answer for this???

Hi Mohammed,

Can you describe how you have set up the duplication check? Are all of the duplicate cases assigned to the user who is checking for duplicates?

hi dear Clayton,

thanks for your reply, dear i followed all the steps in the link provided, what i have is name as text field and date as date of birth after the user enters the name and the date of birth, another label after them will be affected checking the duplication if there is any, the function that is written in the label`s validation condition is: ( count(instance(‘casedb’)/casedb/case[@case_type = ‘distribution’][last_name = #form/name][date_of_birth = #form/date_of_birth]) = 0 ).

all the users are in a shared group.

Hey mohammed

that expression looks like it will return a true when you DON’T have a duplicate.
you’re counting the cases, and it will then return true when the count is 0. i think, with that expression, when the count is > 0, you should return “true”

that might be it.

are you getting that label when you’re entering a new beneficiary that doesn’t have duplicates?

hi dear Mazen,

yes i get that label when i enter new beneficiaries.

Mazz’s interpretation sounds right. The label as written now will appear when the count = 0, which aligns with your description of appearing for new beneficiaries. Switching from an ‘=’ sign to a ‘>’ sign should make the label appear only for duplicate entries instead.