• Categories

  • Tags

  • Cloud Assist on Twitter

  • Archives

  • Google Apps Script for User Account Creation

    Google have included a great new feature to the GAPPS scripting capability. You are now able to manage and add/remove users with Google Apps Script.

    Manage Google Apps Domains and access information about user accounts.This service provides access to the Google Apps Domain Management APIs and can only be used by accounts with administrative privileges on the domain.

    Recently we used Google Apps script to automate the collation of information across multiple spreadsheets, simple javascript. Here is an example of a section of code used:

    function importNewUsers()
    {
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var contacts = ss.getSheets()[0];
      var survey = ss.getSheets()[2];
      var collate = ss.getSheets()[3];
    
      var survey_results = ss.getSheets()[2].getLastRow();
      var collate_rows = ss.getSheets()[3].getLastRow();
    
      if(survey_results > collate_rows)
      {
          var number_rows_needed = (survey_results - collate_rows);
          collate.insertRowsAfter(collate_rows,number_rows_needed);
      }
    
      survey.getRange("F3:F"+survey_results)
          .copyTo(collate.getRange(2, getColIndexByName("Email")), {contentsOnly:true});
      survey.getRange("G3:G"+survey_results)
          .copyTo(collate.getRange(2, getColIndexByName("FirstName")), {contentsOnly:true});
      survey.getRange("H3:H"+survey_results)
          .copyTo(collate.getRange(2, getColIndexByName("LastName")), {contentsOnly:true});
      survey.getRange("T3:T"+survey_results)
          .copyTo(collate.getRange(2, getColIndexByName("userComment")), {contentsOnly:true});
    }
    

    Tags: , , , , , ,

    WP Like Button Plugin by Free WordPress Templates