# Need Help

**URL:** <https://forum.getodk.org/t/need-help/1383>\
**Category:** Support\
**Created:** [June 19, 2012, 7:53am UTC](https://forum.getodk.org/t/need-help/1383 "2012-06-19T07:53:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Irfan\_Ghumman](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/i/90db22/32.png) [@Irfan\_Ghumman](https://forum.getodk.org/u/Irfan_Ghumman)\
**Post date:** [June 19, 2012, 7:53am UTC](https://forum.getodk.org/t/need-help/1383/1 "2012-06-19T07:53:57Z")

</div>

Dear ODK Group,  
I have couple of question regarding ODK Collect development.  
1- I want to add "7 Digit, Auto, Unique and Sequential ID Number  
for each interview on PDA" in ODK.  
2- Is there is any way to control group repeation loop based on a  
Number field, instead of asking option for next repeat.  
It would be highly appreciable if someone send me examples to tackle above  
issues.  
Thank you in advance.  
BR  
Irfan

---

<div class="post-metadata">

**Author:** ![Oliver](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/o/85f322/32.png) [@Oliver](https://forum.getodk.org/u/Oliver)\
**Post date:** [June 20, 2012, 10:23am UTC](https://forum.getodk.org/t/need-help/1383/2 "2012-06-20T10:23:33Z")

</div>

Waylon just answered me to this question in another post.

Here's the link he gave me:  
[http://opendatakit.org/help/form-design/binding/](http://opendatakit.org/help/form-design/binding/)

Down the page there is a section on repeating a group a defined number of  
times. There are posts here that state a problem with this function, but it  
seems to be fixed, as I just tested it and it worked.

> **···**
>
> On Tuesday, June 19, 2012 9:53:57 AM UTC+2, Irfan wrote: \> \> Dear ODK Group, \> I have couple of question regarding ODK Collect development. \> 1- I want to add "7 Digit, Auto, Unique and Sequential ID Number \> for each interview on PDA" in ODK. \> 2- Is there is any way to control group repeation loop based on a \> Number field, instead of asking option for next repeat. \> It would be highly appreciable if someone send me examples to tackle above \> issues. \> Thank you in advance. \> BR \> Irfan \>

---

<div class="post-metadata">

**Author:** ![Steven\_Nsubuga1](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/s/ba9def/32.png) [@Steven\_Nsubuga1](https://forum.getodk.org/u/Steven_Nsubuga1)\
**Post date:** [June 20, 2012, 9:52am UTC](https://forum.getodk.org/t/need-help/1383/3 "2012-06-20T09:52:25Z")

</div>

Irfan, in regard to number 2, do a search on this list, this question has  
been asked and answered before.

> **···**
>
> On Tue, Jun 19, 2012 at 10:53 AM, Irfan Ghumman wrote:
> 
> > Dear ODK Group,  
> > I have couple of question regarding ODK Collect development.  
> > 1- I want to add "7 Digit, Auto, Unique and Sequential ID Number  
> > for each interview on PDA" in ODK.  
> > 2- Is there is any way to control group repeation loop based on a  
> > Number field, instead of asking option for next repeat.  
> > It would be highly appreciable if someone send me examples to tackle above  
> > issues.  
> > Thank you in advance.  
> > BR  
> > Irfan
> > 
> > --  
> > Post: [opendatakit@googlegroups.com](mailto:opendatakit@googlegroups.com)  
> > Unsubscribe: [opendatakit+unsubscribe@googlegroups.com](mailto:opendatakit+unsubscribe@googlegroups.com)  
> > Options: [http://groups.google.com/group/opendatakit?hl=en](http://groups.google.com/group/opendatakit?hl=en)
> 
> --  
> Steven Nsubuga  
> Mobile: +256772712983  
> [snsubuga@grameenfoundation.org](mailto:snsubuga@grameenfoundation.org)  
> Skype ID: stebugz  
> Software Developer  
> AppLab Uganda  
> To enable the poor, especially the poorest, to create a world without  
> poverty

---

<div class="post-metadata">

**Author:** ![W\_Brunette](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/w_brunette/32/4116_2.png) [@W\_Brunette](https://forum.getodk.org/u/W_Brunette)\
**Post date:** [June 20, 2012, 7:07pm UTC](https://forum.getodk.org/t/need-help/1383/4 "2012-06-20T19:07:58Z")

</div>

With regards to your first question:

I am not sure how to do sequential numbers because that requires some  
sort of state to exist between survey instances and collect currently  
does not have the ability to not cross reference information between  
instances. Also the numbers could collide across phones or if you  
reinstall collect. To ensure that no number collisions happens you  
have to have lots of state like how many phones, last install, etc and  
I bet there would still be problems. May I suggest using  
"InstanceId"s. That way you will also get the benefit of ODK tools  
recognizing unique surveys so you don't have double submissions.

[http://groups.google.com/group/opendatakit/browse\_thread/thread/f77bf8942cdfe182/7c9f83d89b7cb2f6?lnk=gst&q=generating+number+collect#7c9f83d89b7cb2f6](http://groups.google.com/group/opendatakit/browse_thread/thread/f77bf8942cdfe182/7c9f83d89b7cb2f6?lnk=gst&q=generating+number+collect#7c9f83d89b7cb2f6)

Alternatively you could make each survey into a repeat group and count  
the number of surveys and add that to a number but seems dangerous as  
you are dependent on one instance and if someone deletes the instance,  
or it errors or gets corrupted you could lose everything from that  
survey. While I would recommend this approach it is possible to do  
what you want using calculate and count the number of repeats.

> **···**
>
> On Wed, Jun 20, 2012 at 3:23 AM, Oliver wrote: \> Waylon just answered me to this question in another post. \> \> Here's the link he gave me: \> http://opendatakit.org/help/form-design/binding/ \> \> Down the page there is a section on repeating a group a defined number of \> times. There are posts here that state a problem with this function, but it \> seems to be fixed, as I just tested it and it worked. \> \> \> On Tuesday, June 19, 2012 9:53:57 AM UTC+2, Irfan wrote: \>\> \>\> Dear ODK Group, \>\> I have couple of question regarding ODK Collect development. \>\> 1- I want to add "7 Digit, Auto, Unique and Sequential ID Number \>\> for each interview on PDA" in ODK. \>\> 2- Is there is any way to control group repeation loop based on a \>\> Number field, instead of asking option for next repeat. \>\> It would be highly appreciable if someone send me examples to tackle above \>\> issues. \>\> Thank you in advance. \>\> BR \>\> Irfan \> \> -- \> Post: opendatakit@googlegroups.com \> Unsubscribe: opendatakit+unsubscribe@googlegroups.com \> Options: http://groups.google.com/group/opendatakit?hl=en

---

<div class="post-metadata">

**Author:** ![Irfan\_Ghumman](https://getodk.b-cdn.net/letter_avatar_proxy/v4/letter/i/90db22/32.png) [@Irfan\_Ghumman](https://forum.getodk.org/u/Irfan_Ghumman)\
**Post date:** [June 21, 2012, 8:38pm UTC](https://forum.getodk.org/t/need-help/1383/5 "2012-06-21T20:38:25Z")

</div>

Dear Burnette,  
I was generating Sequential unique ID for each form in CSPro by following  
steps:  
1- Generate a text file with a desired number in it.  
2- Programe get that number from text file and add 1 for new instance.  
3- Once new instance is occured and ID is assigned old text file is  
replaced by new file with new number.  
4- Same process is continues for every new instance.

Can we do same process in ODK.

> **···**
>
> On Thu, Jun 21, 2012 at 12:07 AM, W. Brunette wrote:
> 
> > With regards to your first question:
> > 
> > I am not sure how to do sequential numbers because that requires some  
> > sort of state to exist between survey instances and collect currently  
> > does not have the ability to not cross reference information between  
> > instances. Also the numbers could collide across phones or if you  
> > reinstall collect. To ensure that no number collisions happens you  
> > have to have lots of state like how many phones, last install, etc and  
> > I bet there would still be problems. May I suggest using  
> > "InstanceId"s. That way you will also get the benefit of ODK tools  
> > recognizing unique surveys so you don't have double submissions.
> > 
> > [http://groups.google.com/group/opendatakit/browse\_thread/thread/f77bf8942cdfe182/7c9f83d89b7cb2f6?lnk=gst&q=generating+number+collect#7c9f83d89b7cb2f6](http://groups.google.com/group/opendatakit/browse_thread/thread/f77bf8942cdfe182/7c9f83d89b7cb2f6?lnk=gst&q=generating+number+collect#7c9f83d89b7cb2f6)
> > 
> > Alternatively you could make each survey into a repeat group and count  
> > the number of surveys and add that to a number but seems dangerous as  
> > you are dependent on one instance and if someone deletes the instance,  
> > or it errors or gets corrupted you could lose everything from that  
> > survey. While I would recommend this approach it is possible to do  
> > what you want using calculate and count the number of repeats.
> > 
> > On Wed, Jun 20, 2012 at 3:23 AM, Oliver [hehf.heidelberg@googlemail.com](mailto:hehf.heidelberg@googlemail.com) wrote:
> > 
> > > Waylon just answered me to this question in another post.
> > > 
> > > Here's the link he gave me:  
> > > [http://opendatakit.org/help/form-design/binding/](http://opendatakit.org/help/form-design/binding/)
> > > 
> > > Down the page there is a section on repeating a group a defined number of  
> > > times. There are posts here that state a problem with this function, but  
> > > it  
> > > seems to be fixed, as I just tested it and it worked.
> > > 
> > > On Tuesday, June 19, 2012 9:53:57 AM UTC+2, Irfan wrote:
> > > 
> > > > Dear ODK Group,  
> > > > I have couple of question regarding ODK Collect development.  
> > > > 1- I want to add "7 Digit, Auto, Unique and Sequential ID Number  
> > > > for each interview on PDA" in ODK.  
> > > > 2- Is there is any way to control group repeation loop based on  
> > > > a  
> > > > Number field, instead of asking option for next repeat.  
> > > > It would be highly appreciable if someone send me examples to tackle  
> > > > above  
> > > > issues.  
> > > > Thank you in advance.  
> > > > BR  
> > > > Irfan
> > > 
> > > --  
> > > Post: [opendatakit@googlegroups.com](mailto:opendatakit@googlegroups.com)  
> > > Unsubscribe: [opendatakit+unsubscribe@googlegroups.com](mailto:opendatakit+unsubscribe@googlegroups.com)  
> > > Options: [http://groups.google.com/group/opendatakit?hl=en](http://groups.google.com/group/opendatakit?hl=en)
> > 
> > --  
> > Post: [opendatakit@googlegroups.com](mailto:opendatakit@googlegroups.com)  
> > Unsubscribe: [opendatakit+unsubscribe@googlegroups.com](mailto:opendatakit+unsubscribe@googlegroups.com)  
> > Options: [http://groups.google.com/group/opendatakit?hl=en](http://groups.google.com/group/opendatakit?hl=en)
> 
> # -- Irfan Sarwar Ghumman
> 
> Gmail: [ighumman@gmail.com](mailto:ighumman@gmail.com)  
> Unicef: [isghumman@unicef.org](mailto:isghumman@unicef.org)  
> Skype: irfan.ghumman  
> Cell: 0092 300 9549598

---

<div class="post-metadata">

**Author:** ![W\_Brunette](https://getodk.b-cdn.net/user_avatar/forum.getodk.org/w_brunette/32/4116_2.png) [@W\_Brunette](https://forum.getodk.org/u/W_Brunette)\
**Post date:** [June 21, 2012, 9:45pm UTC](https://forum.getodk.org/t/need-help/1383/6 "2012-06-21T21:45:00Z")

</div>

You can do that but it will require some modifications to the code  
base. The code is freely available on our code website  
[http://code.google.com/p/opendatakit/](http://code.google.com/p/opendatakit/).

If you do not have the technical ability in your organization to make  
the necessary change may I suggest looking at the companies that are  
willing to be hired to help on our website.

> **[ODK - Collect data anywhere](https://getodk.org/)**
>
> Powerful offline forms to collect the data you need wherever it is. Used by leading researchers, field teams, and M&E professionals to build a better world.

Waylon

> **···**
>
> On Thu, Jun 21, 2012 at 1:38 PM, Irfan Ghumman wrote: \> Dear Burnette, \> I was generating Sequential unique ID for each form in CSPro by following \> steps: \> 1- Generate a text file with a desired number in it. \> 2- Programe get that number from text file and add 1 for new instance. \> 3- Once new instance is occured and ID is assigned old text file is replaced \> by new file with new number. \> 4- Same process is continues for every new instance. \> \> Can we do same process in ODK. \> \> On Thu, Jun 21, 2012 at 12:07 AM, W. Brunette wrote: \>\> \>\> With regards to your first question: \>\> \>\> I am not sure how to do sequential numbers because that requires some \>\> sort of state to exist between survey instances and collect currently \>\> does not have the ability to not cross reference information between \>\> instances. Also the numbers could collide across phones or if you \>\> reinstall collect. To ensure that no number collisions happens you \>\> have to have lots of state like how many phones, last install, etc and \>\> I bet there would still be problems. May I suggest using \>\> "InstanceId"s. That way you will also get the benefit of ODK tools \>\> recognizing unique surveys so you don't have double submissions. \>\> \>\> \>\> http://groups.google.com/group/opendatakit/browse\_thread/thread/f77bf8942cdfe182/7c9f83d89b7cb2f6?lnk=gst&q=generating+number+collect#7c9f83d89b7cb2f6 \>\> \>\> Alternatively you could make each survey into a repeat group and count \>\> the number of surveys and add that to a number but seems dangerous as \>\> you are dependent on one instance and if someone deletes the instance, \>\> or it errors or gets corrupted you could lose everything from that \>\> survey. While I would recommend this approach it is possible to do \>\> what you want using calculate and count the number of repeats. \>\> \>\> On Wed, Jun 20, 2012 at 3:23 AM, Oliver wrote: \>\> \> Waylon just answered me to this question in another post. \>\> \> \>\> \> Here's the link he gave me: \>\> \> http://opendatakit.org/help/form-design/binding/ \>\> \> \>\> \> Down the page there is a section on repeating a group a defined number \>\> \> of \>\> \> times. There are posts here that state a problem with this function, but \>\> \> it \>\> \> seems to be fixed, as I just tested it and it worked. \>\> \> \>\> \> \>\> \> On Tuesday, June 19, 2012 9:53:57 AM UTC+2, Irfan wrote: \>\> \>\> \>\> \>\> Dear ODK Group, \>\> \>\> I have couple of question regarding ODK Collect development. \>\> \>\> 1- I want to add "7 Digit, Auto, Unique and Sequential ID \>\> \>\> Number \>\> \>\> for each interview on PDA" in ODK. \>\> \>\> 2- Is there is any way to control group repeation loop based on \>\> \>\> a \>\> \>\> Number field, instead of asking option for next repeat. \>\> \>\> It would be highly appreciable if someone send me examples to tackle \>\> \>\> above \>\> \>\> issues. \>\> \>\> Thank you in advance. \>\> \>\> BR \>\> \>\> Irfan \>\> \> \>\> \> -- \>\> \> Post: opendatakit@googlegroups.com \>\> \> Unsubscribe: opendatakit+unsubscribe@googlegroups.com \>\> \> Options: http://groups.google.com/group/opendatakit?hl=en \>\> \>\> -- \>\> Post: opendatakit@googlegroups.com \>\> Unsubscribe: opendatakit+unsubscribe@googlegroups.com \>\> Options: http://groups.google.com/group/opendatakit?hl=en \> \> \> \> \> -- \> Irfan Sarwar Ghumman \> ================= \> Gmail: ighumman@gmail.com \> Unicef: isghumman@unicef.org \> Skype: irfan.ghumman \> Cell: 0092 300 9549598 \> \> -- \> Post: opendatakit@googlegroups.com \> Unsubscribe: opendatakit+unsubscribe@googlegroups.com \> Options: http://groups.google.com/group/opendatakit?hl=en
