Dear Openforis Team In my survey new trees shall get an automatically generated ID (1, 2, 3...). For this I created a Number Attribute field and checked "Calculated". How do I define the Expression so that the ID always rises +1. Thanks for your help, Sabrina asked 09 Apr '19, 09:59 Sabrina |
Hi Sabrina, checked as "Calculated" it is not necessary. In "Default Value" you have to write Expression math:max(parent()/tree/tree_id)+1 where: "tree" is Entity name "tree_id" is Number attribute name best regards beka answered 09 Apr '19, 11:13 beka |
Dear Sabrina,
The items defined in the default values section work like this: Collect iterates over the items defined there and when it finds an item that verifies the condition defined in the "Apply if" expression, it calculates the value to apply using the Constant field or the Expression field. If you don't specify any expression in the "Apply if" field, it means "always true" (this is why you can leave it empty only for the last item, otherwise the other items won't ever be evaluated). Thanks, answered 18 Apr '19, 11:03 Stefano (OF) ♦♦ |
Thanks Beka, that helped. Is it also possible that the numbering of the ID starts at 100? For example 101, 102... answered 18 Apr '19, 10:13 Sabrina |