automatic numbering of the trees

  • Asked
  • Active
  • Viewed 7796 times
0

Hello everybody
In my survey there are plots with informations existing trees. On these plots new trees should be added. These should be numbered automatically. How can I generate a consecutive numbering that follows the highest number of existing trees? For example: Existing trees have the number 1-10 and the first new tree should automatically receive the number 11.

Thanks for your advice

0

Accepted answer

Hi,

You have to write expression in "Default Value"

math:max(parent()/tree/tree_id)+1

where tree-is Entity

tree_id - is Number attribute

best regards

beka

0

Accepted answer

when I try this I get the following error message: [RPC Fault faultString="Circular dependency found in graph for node /inventur/plot/pb[2]/baumnr_neu"

0

Accepted answer

can you tall me names of tree "Entity" and "Number attribute" from you survey?

0

Accepted answer

the "Entity" is pb and the "Number attribut" is baumnummer_neu

0

Accepted answer

under baumnummer_neu, try this expression in "Default Value"

math:max(parent()/pb/baumnummer_neu)+1

0

Accepted answer

Unfortunately, that doesn't work. In collect the tree number is not adjusted and in collect mobile it crashes when I add a new tree.

0

Accepted answer

see also picture example from our survey alt text

0

Accepted answer

I can't explain why it's not working. I do everything the way you do it. Maybe I can send you a screenshot?

Your answer

Markdown text. Shortcuts: Ctrl+B bold, Ctrl+I italic, Ctrl+K link, Ctrl+E code, Ctrl+Shift+V paste as plain text. Tab indents list items and code; press Escape, then Tab, to leave the text box.

Insert an image

Say what the image shows, for people who can't see it.

Keyboard shortcuts

Anywhere

?
Show this list
/
Search
g h
Go to the home page
g q
Go to the questions
g t
Go to the tags
g u
Go to the users
a
Ask a question

Lists of questions

j k
Next or previous question
Enter
Open the question

Question pages

j k
Next or previous post

Shortcuts never apply while you type in a text field. Members can turn them off in their preferences.