Hi, Does default value work also for taxonomy fields? I am trying to get the previous tree record's species and fill in the current species field:
tree_id is a simple idm:position() field. Thanks! Andras |
Hi András, |
Hi András,
Let us know if it feets your needs. |
Hi! Sorry to be a bit vague. tree_id is calculated using idm:position() (good to know you have now $context btw. :) ). Then just for example's sake I have the default value expression as follows:
applied when:
What happens at the moment is that species for tree #2 is not filled in but both scientific and vernacular fields can be left empty (even though attribute is set to be required and relevant). I was wondering could this be due to the fact that a single taxon attribute is connected to multiple boxes (scient. and vernac.)? |
Hi, I guess this will then fail in my case based on your response ("applied only when the new row of the tree table is created"). I would like to do this for forks (just wanted to have a simple example). Meaning that the user has to indicate first if the current tree record is a fork. If it is and it's not a first fork, species is copied from the previous tree record. Apparently this is not how it works. Or could this work in Collect Mobile? In any case I wanted to try this with the example above, I have made all the changes you have suggested and it still doesn't work. Using Collect version 3.23.5. Can you duplicate the issue? Thanks! |
Hi András, |
Hi, Thanks for this work-around. My problem is still to get Collect to copy the previous species record to the following row. Below default value definition for the previous_species calculated attribute. tree_id is calculated using idm:position(). Based on the second answer I had the impression that this should work. Am I missing something? |
Hi all, thank you for this useful expression. I have used it extensively in my survey. However, while it works fine in most cases, I do have a problem with an attribute (code) that is relevant (and visible) "only when expression is verified" related to the previous attribute. Here, the expression Any idea what I could do to make it work in this case? Cheers, Alex |