---
title: "Start value for automatic numbering"
url: "https://openforis.support/questions/2681/start-value-for-automatic-numbering"
tags: ["collect"]
status: "accepted"
score: 0
answer_count: 2
asked: "2020-02-17T12:02:04"
last_activity: "2020-02-19T13:13:34"
source: "Open Foris Support - Q&A Forum"
license: "Copyright Open Foris, 2026. Some rights reserved under creative commons license."
---

# Start value for automatic numbering

Asked by Sabrina on 2020-02-17

Hi OF Team  
I would like to inquire about the automatic numbering of objects. See this [forum post][1].

I want the automatic numbering of objects to start at 100 and to be set in steps of one: So 101, 102, 103...   

With a default value of **math:max((parent()/pb/treenumber)+100)+1** it did not work.  (Where *pb* is the parent entity and *treenumber* a number attribute.  

With a default value of **math:max(parent()/pb/treenumber)+101** it does not work either. The series 101, 202, 303 is created.  

How to write the correct max:math code?

Thanks for yiur support


  [1]: http://www.openforis.org/support/questions/2644/automatic-numbering-of-the-trees


## Accepted answer (score 1, by Stefano (OF) on 2020-02-17)

Link: https://openforis.support/questions/2681/start-value-for-automatic-numbering/2684

Dear Sabrina,  
In your case you have to define 2 expressions: 

 - in the first expression you should write **math:max(parent()/pb/treenumber) + 1** and in Apply when specify **count(parent()/pb) > 1** 
 - in the other one just write **101** in the `Constant` field.  


Many thanks,  
Open Foris Team


## Answer (score 0, by Sabrina on 2020-02-19)

Link: https://openforis.support/questions/2681/start-value-for-automatic-numbering/2688

Hi OF Team

Many thanks for your advice. Now it works perfectly!

Best regards
