Hello! I am building an app which aims to ga...

(Vanessa Mares Porto) #1

Hello!

I am building an app which aims to gather all possible data and keep track of all the changes that an user could make on it.

Therefore I created a system which automatically makes a row out of date and creates a new up to date row when a user changing any information in the app.

In fact, on the user’s point of view, he is editing the information, but from our point of view, this new information is going to be saved and considered up to date, while the old row is out of date.

The problem is that I cannot track this information by the key (generated with the UNIQUE ID) since it changes everytime I copy this row.

Is there any possibility of copying the same key in this case, to allows me to keep track of all the changes made?

(Vanessa Mares Porto) #2

+Steve Coile Yep! Exactly!

(Steven Coile) #3

@Vanessa_Mares_Porto Another thing that might make life easier is to mark the old record as archived after copying it for the new record, then you can easily differentiate (e.g. in a slice) current from historic records.

(Vanessa Mares Porto) #4

+Steve Coile Hi Steve! This second part I didn’t understand very well. Could you explain me maybe with an example? Thank you!

(Steven Coile) #5

@Vanessa_Mares_Porto Presumably, you’re using actions to make a copy of the current record and make the copy available for editing. As part of that sequence, add a step to mark the old record as archived.

By way of example, suppose you have a simple record with the columns: [RowID] (the key), [BaseID] (for tracking history), [Data] (the data you’re recording), [Archived?] (whether this record is current or historic).

[RowID] would have an Initial value of =uniqueid(). When the row is copied, each copy would get a new unique value.

[BaseID] would have an Initial value of =[RowID], so for the first record in a series, both [RowID] and [BaseID] would be the same. When the row is copied, the copy would get a new [RowID], but would retain the [BaseID] of the old row. All rows with the same [BaseID] value represent the history of the row starting with the [RowID] = [BaseID].

[Archived?] would have an Initial value of =false. When the row is copied, the [Archived?] value of the old column should be set to true, marking it as historic.

You might then have a slice that includes only current (non-archived) rows, using the selection expression: =not([Archived?]).

(Vanessa Mares Porto) #6

OK!! thanks +Steve Coile! I am going to try this!! Have a nice day!

(Stephen Mattison) #7

+Steve Coile

Wow, great work!

TY!