Automating Document Uploads to SharePoint for a Travel Agency

The Challenge

A travel agency using a custom booking system had a recurring bottleneck: every day, agents manually downloaded generated documents - invoices, itineraries, quotes - and uploaded them to the correct client folders on SharePoint. This was time-consuming, error-prone, and inconsistent. Documents were often misplaced, misnamed, or left unsorted, leading to frustration and inefficiencies across teams.

SharePoint was already the company-wide document hub, but this repetitive task was pulling agents away from more valuable work - like actually helping clients.

The Solution

To solve this, I built an automated system into their existing Ruby on Rails 7 application, leveraging ActiveStorage and Microsoft's Graph API to upload documents directly to the correct SharePoint folders immediately after they were generated.

Key highlights of the implementation:

  • Microsoft Graph API Integration: Using OAuth-secured API calls, I established a seamless bridge between ActiveStorage and SharePoint.
  • Smart Folder Routing: Each document type (invoice, itinerary, quote, etc.) was routed based on its prefix to the correct folder structure - organized by agent and holiday.
  • Dynamic Naming Conventions: Documents were automatically named using a consistent structure: DocumentType_ClientName_HolidayDate.pdf, with full sanitization and checks to prevent overwrites or duplicates.
  • Decoupled Upload Flow: Documents still pass through ActiveStorage, ensuring the internal app retains a full record, while asynchronously syncing with SharePoint in the background.

The Results

The new system replaced a tedious manual process with a fully automated pipeline that just works. Agents no longer need to think about naming, uploading, or organizing - everything is handled instantly and accurately.

Key Benefits

  • Time Savings: Eliminated dozens of daily manual uploads across the team.
  • Error Reduction: No more misnamed files or misplaced documents.
  • Consistency: Standardized naming and folder structures across the board.
  • Searchability: Better document retrieval through consistent naming and folder logic.

The Hardest Part

Since I didn't have direct access to the client's SharePoint environment, robust testing was essential. I built out test suites and mock environments to simulate folder structures, API responses, and permission handling - ensuring confidence in deployment without ever touching live data.

Lessons & Takeaways

Automating the flow of documents from internal systems to cloud-based platforms like SharePoint can offer substantial operational benefits. In this case, replacing manual uploads with a seamless, rules-based system led to better consistency, reduced errors, and significant time savings for the team.

Integrations like this demonstrate how existing infrastructure can be enhanced without disrupting core workflows. By aligning automation with familiar tools, organizations gain efficiency without requiring major process changes - a practical and scalable approach to modernizing everyday operations.

About the Author

Werner Petrick profile picture

Werner Petrick

Software Engineer

Werner is a tenacious problem solver at puzzl with a knack for creative solutions and clear communication. He picks up new concepts quickly, documents his findings thoroughly, and thrives on tackling fresh challenges. Always eager to contribute, Werner is a driving force behind some of puzzl's most innovative initiatives.

About the Client

Go2Africa logo

Go2Africa

Luxury Safari Travel Specialists

go2africa.com ↗
“We've thrown more and more complicated tasks at the team, and everything keeps coming back without issue! We efficiently incorporated Puzzl into our team, even without spending much time together.”
- Ben Hart, CTO