Preloading and constraint

J’ai un souci dans mon questionnaire. En effet, je veux faire un questionnaire de quatre questions: Matricule, Nom, Prénom et Numéro de téléphone. l’ensemble de ces informations se trouve dans un fichier externe donne.csv et je veux quand on saisit le matricule que le Nom, Prénom et le Numéro de téléphone se charge automatiquement en utilisant la fonction Pullda. Mais je n’arrive pas à gérer deux contraintes: (1) le matricule doit exister dans le fichier externe sinon on retourne un message d’erreur; (2) le matricule doit être préchargé une et une seule fois lors de la saisie sinon un message d’erreur le matricule est déjà préchargé.

Welcome to the community, @winnie1993!

Regarding your queries:

(1) the personnel number must exist in the external file otherwise we return an error message

You should be able to achieve this by following this post discussed previously:

  1. the personnel number must be preloaded once and only once when entering otherwise an error message the personnel number is already preloaded

And you should be able to avhice this by following this post discussed previously:

I get errors:

unable to deploy

Votre fiche ne peut pas être affichée car elle contient des erreurs.

ODK Validate Errors: >> Something broke the parser. See above for a hint. Error evaluating field ‘C1’ (${C1}[1]): The problem was located in Calculate expression for ${C1} XPath evaluation: Instance referenced by instance(survey)${data} does not exist Caused by: org.javarosa.xpath.XPathMissingInstanceException: The problem was located in Calculate expression for ${C1} XPath evaluation: Instance referenced by instance(survey)${data} does not exist … 10 more The following files failed validation: ${tmpc2796fyv} Result: Invalid

my problèm is “data” :

count(instance(‘survey’)/root/data[matricule = current()/…/matricule])

the application is deployed on our internal server