Hello again, In my survey, I repeatedly sample the same taxa. Hence, in order not to enter all information over and over again, I would like Open Foris to recognise whether a taxon had already been sampled within the sampling unit. So far, I unsuccessfully tried with the following code which is to be added into the "only when expression is verified" field: true(idm:contains(parent()/a_in_ind/taxon,taxon)) Am I getting it wrong? Thanks for the help in advance, Jan asked 16 Mar '22, 10:42 janklein |
Dear Jan,
Then you could verify, into another calculated attribute, hidden in data entry, that the same species has been already sampled in another calculated attribute (e.g.
that means that there is at least one row in your table having the same species code of the current row. The expression Let us know if this will help you to solve your problem. answered 16 Mar '22, 22:24 Stefano (OF) ♦♦ |
Dear Stefano, thank you very much for your quick reply. The workaround works fine. Just one last question: How can I use species_already_sampled as a condition? It seems like it outputs a boolean (true/false). When trying to code "true(species_already_sampled)", OF runs into an error. I also tried "species_already_sampled = 'true'", but the code doesn't work. Thanks again, Jan answered 17 Mar '22, 09:49 janklein |
Dear Jan, answered 17 Mar '22, 14:36 Stefano (OF) ♦♦ |
Hello again, After having implemented the workaround described above it appears to be working for the first but not for the following subplot entities. Each plot is subdivided into 8 entities (sub-plots). Each sub-plot contains the following three attributes relevant to the question: - taxon: taxa from species list - taxon.code: taxon/@code as integer - taxon.already.sampled: text attribute calculated based on the following expression:
In the first entity (subplot 1), the field taxon.already.sampled correctly recognises when a taxon has already been sampled (true) and when it has not yet been sampled (false). The problem evolves in the second (and the following) subplot. We would like OF to recognise if a taxon had already been sampled in any subplot (not only the current one). Thus, I added a second term to incorporate the former entities in the attribute taxon.already.sampled, resulting in the following expression:
This code, though, does not work correctly. The field taxon.already.sampled remains ‘true’ for all newly added taxa, regardless of whether or not they had already been sampled within the current or a former subplot. The validation rules based on this attribute are thus not correctly warning the user if a specimen needs to be collected or not. It seems that the expression in subplot2 fails to extract from subplot1. Which expression should I use in the taxon.already.sampled field to check for correspondences within all subplot entities? Thank you very much in advance, Jan answered 28 Mar '23, 12:24 janklein |