2-way Sync: Non-row ID

  Рет қаралды 1,900

Spencer Farris

Spencer Farris

Күн бұрын

Пікірлер
@rmtgbesds1
@rmtgbesds1 3 жыл бұрын
Thank you. I'll be waiting for the next one. Great script tutorial. It will improve my shared google sheets at my workplace (Portuguese school)
@SpencerFarris
@SpencerFarris 3 жыл бұрын
Que bom! Obrigado e de nada.
@khkgkhkg
@khkgkhkg 3 ай бұрын
This is amazing. Trying to adapt it to run with multiple spreadsheets (to prevent Mary or John from seeing each others work, or the database) but running into problems. Any advice?
@SpencerFarris
@SpencerFarris 23 күн бұрын
What problems are you running into? That setup should work fine
@seabreezebeach93
@seabreezebeach93 2 жыл бұрын
Hi Spencer, what should we modify in the script if the unique id columns is at C?
@SpencerFarris
@SpencerFarris 2 жыл бұрын
if (src.getName() == "Database" || r.rowStart == 1 || r.columnStart == 3) return; and let id = src.getRange(r.rowStart,3).getValue(); Those are the two that actually mark the ID column
@m2mhung
@m2mhung 2 жыл бұрын
@@SpencerFarris how could we change the code when I filter with 2 or or 3 col, ? docs.google.com/spreadsheets/d/19gwkCX22NmDAsWwihSIyOL14GpodKu_HOhv8jamvtN8/edit#gid=0
@eliasnogueira1286
@eliasnogueira1286 2 жыл бұрын
How do I do when the filter formula is not in A2 but in A10 for example? and if I change the column of the filter formula? How do I do this without the header disappearing?
@SpencerFarris
@SpencerFarris 23 күн бұрын
Sorry it's been SO LONG. Do you still need help?
@yannhuet
@yannhuet 2 жыл бұрын
Hey Spencer, awesome tips here! Does this work between 2 different google sheets, instead of 2 tabs in the same sheet? And if so, does all users need read/edit permission to the master google sheet in order for the script to sync data from a child google sheet to a master google sheet?
@SpencerFarris
@SpencerFarris 2 жыл бұрын
It does work between workbooks! kzbin.info/www/bejne/q5SvgGeffbVlgdk Only the user who creates the trigger needs to have edit permissions on both.
@nssdesigns
@nssdesigns 2 жыл бұрын
If you could get this to work with Checkboxes -that would be useful. Saves typing TRUe and FALSE or using data validation [TRUE,FALSE] dropdown on the MARY tab Database allows Checkboxes but the filtered views don't activate (only show the Database state TRUE or FALSE). But thank you this is truly a game changer in data collection within Sheets.
@SpencerFarris
@SpencerFarris 2 жыл бұрын
Yes, I'll be looking into that issue. Thank you for pointing it out!
@mauryhernandez2297
@mauryhernandez2297 2 жыл бұрын
function onEdit(e) { if (!e) throw "Do not run onEdit from script editor"; const src = e.source.getActiveSheet(); const r = e.range; moveProcessed(src,r); syncNonRow(src,r); } function moveProcessed(src, r) { if (src.getName() != "NEW VEHICLES IN" || r.columnStart != 11) return; const dest = SpreadsheetApp.getActive().getSheetByName("ACTIVE PRODUCTION"); r.offset(0, -10, 1, 10).moveTo(dest.getRange(dest.getLastRow() + 1, 1, 1, 10)); src.deleteRow(r.rowStart); } function syncNonRow(src,r){ if (src.getName() == "ACTIVE PRODUCTION" || r.rowStart == 3 || r.columnStart == 2) return; r.clear(); let id = src.getRange(r.rowStart,1).getValue(); const db = SpreadsheetApp.getActive().getSheetByName("ACTIVE PRODUCTION"); const ids = db.getRange("B:B").getValues(); let row = 0; for (row; row < ids.length; row++){ if (ids[row][0] === id) break; } row++; db.getRange(row,r.columnStart).setValue(e.value); } function syncWithRow(e){ if (src.getName() == "ACTIVE PRODUCTION" || r.rowStart == 3 || r.columnStart == 2) return; r.clear(); let id = src.getRange(r.rowStart,2).getValue(); let row = id + 1; let db = SpreadsheetApp.getActive().getSheetByName("ACTIVE PRODUCTION"); db.getRange(row,r.columnStart).setValue(e.value); } Im using the combine 2 scripts code, works except that the value to sync returns the original one... is not overwriting it... any idea?
@SpencerFarris
@SpencerFarris 2 жыл бұрын
I'm sorry, what's the issue?
@mauryhernandez2297
@mauryhernandez2297 2 жыл бұрын
@@SpencerFarris I can make it work the two scrips, but I used a way around so, I might not need anymore... however would be nice make it work the script for use more than one actions or trigger
2-Way Sync: Row-aligned ID
11:21
Spencer Farris
Рет қаралды 2,7 М.
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 28 МЛН
Long Nails 💅🏻 #shorts
00:50
Mr DegrEE
Рет қаралды 19 МЛН
Build a counter with google sheets and Apps Script and drawings
5:20
Google Sheets Tutorials
Рет қаралды 182
Introduction to Dash Plotly - Data Visualization in Python
29:21
Charming Data
Рет қаралды 803 М.
Ukraine has nuclear weapons? / Important statement
11:20
NEXTA Live
Рет қаралды 615 М.
this vulnerability has been hiding for 10 years.
9:32
Low Level
Рет қаралды 155 М.
Google Sheets / Apps Script - Move Data Down with Dropdown
9:00
Spencer Farris
Рет қаралды 416
Google Apps Script: Take Action Based On Formatting
12:51
Spencer Farris
Рет қаралды 156
Conditionally Insert Checkboxes
5:28
Spencer Farris
Рет қаралды 597
I Tested No Code AI App Makers and Found the BEST
16:02
Creator Magic
Рет қаралды 38 М.