The target sheet just needs to contain the column headers. The source sheet should mirror the same structure as the screenshot (below) illustrates. Target sheet: Destination - Numbers Descending.Source sheet: Source - Numbers Ascending.This example will demonstrate a very simple approach where the source spreadsheet will contain five columns where each row contains numbers in ascending order to then be copied to the target spreadsheet in descending order.īefore we add the script, we need to create two spreadsheets: The aim is to carry out automated field mapping, where the script would iterate through each row from the source spreadsheet and create a new row in the target spreadsheet where the cell value would be placed in a different column. The Google App Script I wrote fulfils the job of taking the contents of cells in a row from one spreadsheet to be copied into another. Some really impressive things can be achieved using App Scripts within the Google ecosystem. Refreshing when compared to the more archaic option of using VBA in Microsoft Office. The great thing about Google App Script development is being able to use popular web languages (HTML/CSS/JavaScript) to build something custom. They both can automate repeatable tasks and extend the standard features of the application. You could think of App Scripts as similar to writing a macro in Microsoft Office. Released in 2009, Google App Scripts is a cloud-based platform that allows you to automate tasks across Google Workspace products such as Drive, Docs, Sheets, Calendar, Gmail, etc. This week I felt adventurous and decided to break the mundane job of formatting a spreadsheet using an approach I've been reading up on for some time but just never got a chance to apply in a real-world scenario - Google App Scripts. Whenever there is a need to restructure an Excel spreadsheet to an acceptable form to be used for a SaaS platform or custom application, my first inclination is to build something in C# to get the spreadsheet into a form I require.
0 Comments
Leave a Reply. |