Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9624

Auto Complete Data - Google Spreadsheet Script

$
0
0

I have data management system in which the data is kept at multiple google sheets. Now there is primary sheet where the data gets updated. Is there a way to populate the same data on multiple sheets as i have to manually update the same on every sheet.

Few things, I can't use IMPORTRANGE function as it will populate the data as dynamic values so I can't sort the data according to other static values.

Also, I have tries various google scripts but couldn't find a perfect one. So is there anyway that the two places data is matched against each other and the values which are missing is automatically populated. So far the function that I have tried include...

function onOpen() 
{
  var ui = SpreadsheetApp.getUi();
  ui.createMenu('CopyRange')
      .addItem('Trial', 'Trial')
      .addToUi();
}

function Trial() 
{
  var importedrange = SpreadsheetApp.openById('Key').getRange("Try").getValues();
  var sheet = SpreadsheetApp.getActiveSheet();
  var range = sheet.getRange("TC");
  var range1 = sheet.getRange("TC").getValues();

  if(range1 != importedrange)
  {
    SpreadsheetApp.getUi()
    range.setValues(importedrange);
  }
}

Also, this one more...

var UP = PropertiesService.getDocumentProperties();

function Code()
{
   var sheet = SpreadsheetApp.getActiveSheet();
   var r = sheet.getRange("Try").getValues();
   UP.setProperty('testresult',JSON.stringify(r));  
}

function TC()
{
    var array = UP.getProperty('testresult');
    array = JSON.parse(array);
    return array;
}

Attached a sheet for reference Like need data from sheet 1 to populate in sheet 2.


Viewing all articles
Browse latest Browse all 9624

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>