K
K
kotjj2021-10-11 22:43:47
Google Apps Script
kotjj, 2021-10-11 22:43:47

How to implement cell value logging in Google spreadsheets when it changes?

Good afternoon, the task seems to be simple, but I can’t find the right approach:
There is a sheet with API (sheet1), which is completely updated once a day, and the new value is always in the top line (that is, the old data goes down, and the new ones in the top line) , and the data looks in the "Date Value" format,
61648b64e718a553558062.jpeg
you need to make the data copied to another sheet (Sheet2): but in this format:
61648ef1f14ce866831407.jpeg
Difficulties:
1) The API data from "Sheet1" is only 100 lines, that is, the values ​​\u200b\u200bthat should be in 101 line disappear.
2) The values ​​in "Sheet1" go from bottom to top, and "Sheet2" is required from top to bottom.
3) The missing values ​​after filling 100 lines with "Sheet1" should be saved in "Sheet2"
4) The Sheet API values ​​are only updated when I open the document. The missing data for several days should be copied to "Sheet2" in the correct sequence. (that is, there must be some comparison of the date to the previous value)
In general, the task is to log data by date. I tried a script like logging when changing a cell found on the internet, but it only works if you change the values ​​\u200b\u200bmanually, and even half of the functionality that I need is not. I'm not good at scripting, please help me.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander, 2021-10-12
@ForestAndGarden

Use the SORT() function to "flip" the order of the values.
Services like Zapier will help with logging.

G
Grigory Boev, 2021-10-12
@ProgrammerForever

only updated when i open the document

So the scripts have onOpen () which writes data to Sheet1.
Just add a line for Sheet2 there .
Something like sheet.appendRows(your_data)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question