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 '19, 13:40

bsenterre's gravatar image

bsenterre
101518
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 '19, 17:20

Stefano%20%28OF%29's gravatar image

Stefano (OF) ♦♦
4.7k19
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 '19, 03:00

bsenterre's gravatar image

bsenterre
101518
accept rate: 0%

Dear Foris team, I notice that you have implemented the "calculated only once" option for calculated attribute, having in mind the issue of uuid attribute being recreated each time in Foris. This is nice but it seems not to solve my issue since I cannot set as "key" a calculated attribute??!! Therefore I still cannot create a key attribute which is a uuid calculated only once. If I create a key attribute not calculated and having a uuid as default value, it is still recreated each time I export data from Foris. The reason I need this is because I do not store my data in Foris but in another database system. Is there a solution, other than having to always create unique IDs by combination of up to three attributes? Thanks a lot, Bruno

permanent link

answered 19 Jul '19, 11:51

bsenterre's gravatar image

bsenterre
101518
accept rate: 0%

Dear Bruno,
Allowing calculated attributes to be also "key" is a major change that will require some time to be implemented.
It affects lots of parts of the application (the key attributes are used as a sort of record summary) and involves some developments even in the Collect Mobile application.
We are working on that but please be patient.
Many thanks,
Open Foris Team

permanent link

answered 19 Jul '19, 23:22

Stefano%20%28OF%29's gravatar image

Stefano (OF) ♦♦
4.7k19
accept rate: 20%

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:

×493

question asked: 23 Jan '19, 13:40

question was seen: 2,840 times

last updated: 19 Jul '19, 23:22