Jump to content
  • 0

Timestamp for individual fields


pmcfarlain
 Share

Question

I'd like to be able to timestamp when each individual column is updated. Basically, when column "x" is updated, the column "timestamp_x" is updated with the time "x" was updated and when column "y" is updated, column "timestamp_y" is updated with the time "y" was updated and so on. Is there a way to do this with a trigger? Or within the datapage with HTML or with a calculated value? Let me know if you know a solution! Thanks!

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
10 minutes ago, pmcfarlain said:

I have a table of phases and the goal is to save the time that each phase was completed. I can make a separate table for the timestamps if that would improve speed but I'm still not clear on how to grab the timestamp when a specific column is updated. Are you suggesting I make another table with the previous statuses and just compare if it has changed from one table to the other? I'll definitely have to use the audit trail suggestion in the future but I'm not sure it's as helpful in this specific instance since the columns are simple checkboxes and I don't need to save previous data from them, only the time that they were updated.

Thanks!

I see, then you'll probably need one update block for each field. Your Timestamp field should be a Text or Date Field (you need to use concatenate block if it's a text field)

image.png.2c37f3d743ff54ba89a2a4c4d9dfdb6c.png

For example this one, update #inserted so it will put the timestamp in the field, when #inserted and table check is not equal means it's been updated/changed

Link to comment
Share on other sites

  • 0

Yeah, I guess you can do it on trigger, multiple update blocks for each field where table.fieldX not equal to #inserted.fieldX so you'll know it's been updated when the value is not equal to old one, but, what's your purpose with this? Timestamp with each field would not seem ideal since it can be a lot of fields for your table, and it may slow it down.


What's usually done, though, is something like Audit Trails where you have a separate table to store the changes made

 

Link to comment
Share on other sites

  • 0
On 6/25/2021 at 2:35 PM, TellMeWhy said:

Yeah, I guess you can do it on trigger, multiple update blocks for each field where table.fieldX not equal to #inserted.fieldX so you'll know it's been updated when the value is not equal to old one, but, what's your purpose with this? Timestamp with each field would not seem ideal since it can be a lot of fields for your table, and it may slow it down.


What's usually done, though, is something like Audit Trails where you have a separate table to store the changes made

 

I have a table of phases and the goal is to save the time that each phase was completed. I can make a separate table for the timestamps if that would improve speed but I'm still not clear on how to grab the timestamp when a specific column is updated. Are you suggesting I make another table with the previous statuses and just compare if it has changed from one table to the other? I'll definitely have to use the audit trail suggestion in the future but I'm not sure it's as helpful in this specific instance since the columns are simple checkboxes and I don't need to save previous data from them, only the time that they were updated.

Thanks!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...