I work with children and I, along with a group of my co-workers, have to complete a phone survey with their parents. The answers will be tracked in LimeSurvey.
We're all responsible for calling one group of kids...but some of these kids have siblings that might be in someone else's group. Since the survey already asks if a kid has siblings, we don't want to do double work (e.g., "Jane Doe" already had her name entered because I listed her as a sibling to "John Doe".)
Is there a way to do the following:
- Question #1 (code/ID: "mainName") in the survey asks for the child's name.
- When you enter a child's name, LimeSurvey will search the database for previous answers.
- If it finds a matching name, it shows this error message: "this child is already in database".
More Information
Some families may have up to 6 children, so a child's name could be stored in any of these six fields:
- mainName (Question #1)
- sib1Name
- sib2Name
- sib3Name
- sib4Nam
- sib5Name
(I'm assuming the script will need to check all 6 fields/data entries for possible duplicates, but I could be wrong).
You cannot access previous responses from within LimeSurvey. A solution may be to make an AJAX call to a remote file that uses the API or direct SQL queries to access the data.
Try searching the LimeSurvey forum for "AJAX call" or "API" - https://forums.limesurvey.org/forum/english-support-forums