How to safely add values to an existing datatext Observation Field

Awhile ago, I made a particular observation field of datatype Text, which has a few allowed text values. And I started using it on my relevant observations.

Now I want to add a few more values to it, without altering the existing values, and use those on observations, too. If I add the new values to the end of the Allowed Values string in the edit form, without changing the existing values, will the existing values continue to be recognized on my observations that use them? Could the new values be inserted into a more logical order, rather than appended at the end?

i haven’t tested things out, but i believe the only time the Allowed Values string affects values stored in a given observation field is when validating the values at input/save. this would mean that once a value recorded on the observation field in an observation, it won’t be affected by the Allow Values string unless/until you try to edit the value. so i think you an change the Allowed Values string however you want without affecting existing values recorded in observations.

in other words, if you have an observation field X that has allowed values A, B, C, and there are observations that use A, B, and C, and then you change the allowed values of X to D, B, A, then i believe:

  • the existing A, B, C values recorded in observations should be preserved
  • going forward, you won’t be able to add / edit values to C
  • going forward, you will be able to add / edit values to D
  • going forward, the allowed values will be presented in D, B, A order

I have hoped it work that way. If so, it sounds safe to add new values in any order as long as the existing values don’t change.

if in doubt, you could always do a little test:

  1. create a new observation field Z with allowed values A and B
  2. on observation M, add Z with value A
  3. on observation N, add Z with value B
  4. change allowed values on Z to C and A
  5. check value of Z on observation N. if B, then pass.
  6. check value of Z on observation M. if A, then pass.
  7. on observation O, add Z with value C. if successful, and if C was the first allowed value, then pass.
1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.