In the column ‘B’, set the following Trigger Formula:
import datetime
current_time = NOW().strftime(“%Y-%m-%d %H:%M:%S”)
new_entry = f"{current_time}: { $COLUMN_A }"
return (value + "\n" + new_entry) if value else new_entry
- Note that in the line new_entry = f"{current_time}: { $COLUMN_A }" you will need to change “COLUMN_A” for the name of the real column
Then, check the option “Apply on changes to:” and then select the column ‘A’
DONE!
This is the explanation of the code:
- “NOW().strftime(“%Y-%m-%d %H:%M:%S”)”: gets the current date and time in the format “YYYY-MM-DD HH:MM”
- new_entry: create a new line that includes the date-time and the current value of the ‘A’ column.
- value: refers to the existing value in the column ‘B’. The formula appends the new entry to this existing value, creating a new line each time.
- \n: Represents a newline character, ensuring each change is recorded on a new line.
I would like to give credit for this tip to my friend @Rogerio_Penna. Thank you so much!