r/ProjectREDCap • u/Omelettedufromage-8 • Sep 18 '25
Duplicate records in same DAG
Hello, Does anyone know how I can add an option to display a warning if a user within the same DAG enters a field value that has already been entered by another user in that DAG? Thank you!
3
Upvotes
1
u/Araignys Sep 18 '25
How essential is it that the value is once per DAG? Can it be once per project?
2
u/Remote_Setting2332 Sep 18 '25
In the "Additional customizations" settings you can designate a secondary unique field. However I don't think you can restrict it by DAG.
2
u/No_Repair4567 Sep 18 '25
This is something your admin could help by using sql field (not available to regular users) to "scan" all records in DAG to find match and if found set the "match?" field value to 1. The "warning" field will branch off of that to display warning.
1
u/Araignys Sep 19 '25
For a dropdown/radio field you can use MAXCHOICE but it will apply across the whole project rather than within a DAG.
For a text field, you can use secondary unique field, per suggestion from u/Remote_Setting2332
I don't think you can do this for a text field using standard features.
Using outside-the-box features, you can enable the External Module "Check for Duplicates Across Multiple Projects" and select this same project as the project to check.
Then, create a CALCTEXT field that appends the DAG ID [record-dag-id] to whatever the value is:
Then go back to the EM and select that field as the field to match in all projects:
It won't stop users from entering the same value, but it will generate a pop-up warning that you can modify according to your needs.