I have let's a form with 2 levels. At the first level my 'key' field is a text field with default value as util: uuid (universal id 36 characters). As I collect data, every entry receives a unique uuid. All fine, but the problem is that if I change anything in the survey design (e.g. updating a code listto add new options) and then publish the changes successfully. Then the pre-existing data have had their value in the field uuid recreated. As I am using this Open Foris Collect with a link to another database, it very unpractical. Pre-existing data are not modifiable automatically just by publishing, why would a uuid recreate itself? Any help with this? Best wishes, Bruno

asked 23 Jan, 13:40

bsenterre's gravatar image

bsenterre
111
accept rate: 0%


Dear Bruno,

Why do you need a uuid field to identify your records? Is there any other combination of attributes that makes a record unique? Collect supports up to 3 key attributes per sampling unit.
I suppose that you are using the util:uuid function in a calculated attribute.
The calculated attributes in Collect are re-evaluated every time you load a record, this is why your attribute value changes every time.
Try to make the attribute "not calculated" and use the uuid only as a default value: in this way, the value won't be overwritten, but the users could modify the assigned value...

Many thanks,
Open Foris Team

permanent link

answered 24 Jan, 17:20

OF%20Collect's gravatar image

OF Collect ♦♦
2.5k7
accept rate: 20%

Dear colleague, Thanks a lot for your help. Yes indeed I am using a combination of attributes as unique ID. But the thing is that I only use Collect as an intermediate database and I actually store my data un another database. This means that in my other database I have to recreate the concatenation of the attributes making the unique ID key (no big deal). But to be on the 100% safe side, I would have preferred to use the uuid util function of Collect as a 'calculated' attribute (so it can never be modified after creation and as a key (but be also cannot make 'key' calculated attributes in Collect). If we cannot do that with the util uuid function, then this function is quite useless actually, and user has to stick to combination of attributes anymay (which you never have a garantie that a given object will never change its key ID, in case any of the combining attributes is modified. I also tried to make the uuid attribute as a default attribute rather than a calculated one, but it still recreates these uuid for pre-existing entries each time I re-publish the survey. Besides small details, Open Foris Collect Mobile is an absolutely great tool! Thank you for this great piece of work. Bruno

permanent link

answered 25 Jan, 03:00

bsenterre's gravatar image

bsenterre
111
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×324

question asked: 23 Jan, 13:40

question was seen: 247 times

last updated: 25 Jan, 03:00