Juan Brekes
Project Overview
The client had a spreadsheet that was updated daily with information on travel bookings (accommodations, arrival and departure times, per diem, contact details, insurance, etc.). Each trip had a unique ID.
The client needed to create a preview of the data in the same spreadsheet in order to be able to evaluate each trip separately. In addition, they needed a way to automatically create a new report on demand by specifying the code of a single trip.
As an additional element, the reports created had to remain linked to the master spreadsheet, so that any changes in the source information would be automatically reflected in the new document.
Provided Solution
1 - A tab was created that enables the Master Spreadsheet query, cleans the data and applies the desired formatting. The result shows a preview of how the new document would look like in case you want to generate it.
2 - An automation using AppsScript was devised to create a new Spreadsheet and, by using functions such as QUERY() and IMPORTRANGE() (among others), the necessary information is linked to the Master Spreadsheet.
3 - The result is a new file completely linked to the Master Spreadsheet, so that any change in a record of the indicated trip is automatically reflected in the new document.
4 - Some additional controls were also implemented, such as the review of existing documents on the same trip and the verification of the correct format of the data.
Some Example AppsScript Functions
This function automates the creation of a structured Google Spreadsheet for a specific trip or flight, with multiple tabs pre-populated and formatted based on a master template. It ensures that no duplicate files are created and provides easy access to the newly generated or existing file through user prompts.
This function automates the process of populating, formatting, and conditionally highlighting a Google Sheet tab with emergency insurance data from a master file. It pulls relevant data, formats it for readability, and hides unnecessary columns, ensuring that only the most relevant information is displayed.
Similar processes, with greater or lesser complexity, were created for each spreadsheet tab.