Dear OF team,

I would like to implement autonumbering for tree individuals such as in this post: The field 'num' containing the automatised numbering of tree individuals should not be visible in the data entry form.

I implemented two lines of code:

(1) Constant value = 1

(2) Expression = 'math:max(parent()/a_in_ind/num)+1' apply when 'count(parent()/a_in_ind) > 1'

Adding the first individual works fine but when adding a second, OF runs into the following error: 'Circular dependency found in graph for node /transect/a_in_ind[2]/num'

Thus far, my workaround is to have the 'num' field not calculated, with the very same default expression as mentioned above: 'math:max(parent()/a_in_ind/num)+1'. This works perfectly fine but leaves the 'num' field editable in the data entry, which is a possible source of error, if accidentally modified.

Thanks for any help regarding this problem.

Best, Jan

asked 24 Oct '22, 15:02

janklein's gravatar image

accept rate: 0%

Dear Jan,

one option is to create a calculated attribute and use expression "idm:position()" and in properties uncheck "Show in entry form", and keep "Calculated only one time" checked.

regards Lauri

permanent link

answered 26 Oct '22, 12:10

LauriV's gravatar image

LauriV ♦♦
accept rate: 21%

Thank you, Lauri, your solution works perfectly fine

(26 Oct '22, 14:29) janklein janklein's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 24 Oct '22, 15:02

question was seen: 175 times

last updated: 26 Oct '22, 14:29