I have sheet named origin that displays set of data Col A:B via ImportRange I have a sheet named destination
What I wanted to do:
What I dont want to happen:
Any idea on how I can achieve this? Thank you so much
I would advice you to use a formula in the destination sheet, something like:
UNIQUE(IMPORTRANGE("url", "origin:A1:B"))
so you can have the unique items of the origin
sheet in the destination sheet.
The reason that I am suggesting that is because you are looking for a trigger behaviour. Namely, when a new value is added in a cell, grab this value and send it to another spreadsheet. The problem with this approach is that Google-Apps-Script
triggers are not triggered by scripts nor formulas, but only by user edits. In other words, if a cell is modified by your import range formula, there is not a direct GAS
solution which can figure that out. Only workarounds exist which might have limitations and they are very specific to your exact use case.
See this thread for some info and references.
You can use the Properties Service which you can store some sort of data that is bound the script. In this way, you can create a Time-driven trigger which will run every 1 minute or so and check if there are changes to the original data. If a new value is added, update the property
and send the data to the destination sheet. If no new data is added, do nothing.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.