# Automated Column Management in Inventory Sheet

> Developed an app script to automatically update columns in an inventory sheet based on values in another sheet, enabling seamless data synchronization within Google Sheets.

Section: Google Apps Script

Page: https://mburhan.com/case/gas-automated-column-management-in-inventory-sheet

## Automated Column Management in Inventory Sheet

Automating inventory column updates and synchronizing information between Google Sheets using Google Apps Script.

## Project Overview

This project uses Google Apps Script to update columns in an inventory sheet based on values in another spreadsheet. It also provides custom menu options for updating inventory values and adding leading zeros.

**Tools:** Google Apps Script, Google Sheets.

## 01. The Challenge

Maintaining inventory information across linked spreadsheets requires consistent updates. Manual changes can leave records out of sync, while inventory values such as SKU and location codes may require leading zeros to be preserved.

## 02. The Solution

A Google Apps Script solution was developed to automate inventory updates and synchronize relevant column values between spreadsheets.

The scripts provide custom menu actions to run inventory updates and normalize leading zeros when needed.

## 03. How It Works

- **Read spreadsheet data:** The script accesses the main spreadsheet and relevant inventory sheets.
- **Compare records:** It reads client information and account status values to identify the records that need processing.
- **Update inventory columns:** The script updates inventory-related values based on the information in the linked spreadsheet.
- **Run custom actions:** Users can select options from the Google Sheets custom menu to update inventories or add leading zeros.

## 04. Workflow Architecture

The workflow connects the main spreadsheet, Google Apps Script, and the linked inventory spreadsheet.

Image (https://mburhan.com/uploads/55f648ddf1f06fcda9ded966.png)

### Custom Menu Actions

The provided Apps Script screenshots show these menu options:

- **Update Inventories** — runs the inventory update function.
- **Add Leading Zeros** — runs the function for adding leading zeros.

## 05. Implementation Screenshots

**Inventory synchronization**

The first screenshot shows the Apps Script function for checking account status and synchronizing information between the main sheet and a linked inventory spreadsheet.

Image: Syncing active/inactive status between a main sheet and a linked inventory spreadsheet. (https://mburhan.com/case-content/google-apps-script-portfolio/image10.png)

**Custom inventory menu**

The second screenshot shows the custom menu available in Google Sheets for running inventory updates and adding leading zeros.

Image: A custom menu for updating inventory values and normalizing leading zeros on demand. (https://mburhan.com/case-content/google-apps-script-portfolio/image11.png)

## 06. Tools and Integrations

- **Google Apps Script:** Executes the inventory update and leading-zero functions.
- **Google Sheets:** Stores inventory records and provides the interface for running custom menu actions.

## 07. Outcome

The solution automates inventory column updates between linked spreadsheets and provides on-demand menu actions for inventory updates and leading-zero normalization.
