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
Accepted answer
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