Hello everyone,
I am creating a survey in Survey123 Connect where I need to prevent duplicate submissions for the same farm within the same quarter.
In my survey, I have the following fields:
Reference_FarmID (text input)
submission_quarter (calculate)
submission_year (calculate)
My goal is to ensure that each Reference_FarmID can only be submitted once per quarter. If a record for the same farm has already been submitted in the same quarter and year, the form should block the second
The issue is that no data exists yet in the feature layer, but the form is already restricting me and treating it as a duplicate. It will not allow the very first submission.
How can I correctly configure the duplicate check so that:
The first-ever submission is allowed
Only the second submission in the same quarter is blocked
submission.
type name label calculation constraint constraint_message
| text | Reference_FarmID | Farm Reference ID | count(pulldata("@layer", "Reference_FarmID", "Reference_FarmID", ., "submission_quarter", ${submission_quarter}, "submission_year", ${submission_year})) = 0 | This Farm ID already submitted in ${submission_quarter} ${submission_year} | |
| calculate | submission_quarter | if(format-date(now(), '%m') <= 3, 'Q1', if(format-date(now(), '%m') <= 6, 'Q2', if(format-date(now(), '%m') <= 9, 'Q3', 'Q4'))) | |||
| calculate | submission_year | format-date(now(), '%Y') |
Solved! Go to Solution.