# Copy Account Billing City to Shipping City

**Type:** Apex trigger · **Difficulty:** Easy · **Object:** Account · **Topics:** Account, Before Insert, Field Assignment

Practice this problem interactively (write and run your Apex trigger against realistic data): https://www.forcechallenges.com/problems/copy-account-billing-city-to-shipping-city

## Problem

When an Account is created, copy Billing City into the custom Shipping_City__c field. If Billing City is blank, leave Shipping City unchanged.

## Constraints

Use bulk-safe logic. Do not run SOQL or DML inside loops.

---
Source: ForceChallenges · last updated 2026-10-13
