DEV Community

Stackscale
Stackscale

Posted on

Extract Payslip Data to Google Sheets with Make and OpenAI

Every month a payslip lands in your inbox as a PDF, and someone types the numbers into a sheet by hand. Learn how to extract payslip data to google sheets automatically — Gmail catches the monthly payslip PDF, OpenAI reads gross pay, tax deducted, and net pay off the document, and Google Sheets logs the row so nobody types payslip figures by hand again.

This is the companion tutorial for the StackScale video above. No code, no live payroll, and no real employee data — the whole flow runs on one fictional demo payslip (A Sharma, November 2026) so you can test it safely.

What You Will Build

A Make scenario that watches Gmail for a payslip PDF, sends it to OpenAI to extract the fields, and logs one row in Google Sheets: employee, pay period, gross pay, tax deducted, and net pay. The demo payslip reads gross pay $5,000.00, tax deducted $1,150.00, net pay $3,850.00 — and the arithmetic checks out: $5,000.00 − $1,150.00 = $3,850.00.

Prerequisites / Tools

  • A Make account (free plan is enough to start)
  • A Gmail inbox where payslips arrive
  • An OpenAI key for the extraction step
  • A Google Sheet with five columns: employee, pay period, gross pay, tax deducted, and net pay

Disclosure: Some links below are affiliate links, meaning StackScale may earn a commission at no extra cost to you.

The Workflow

Gmail watches for new messages with a PDF attachment. When the monthly payslip arrives, the scenario starts itself, OpenAI reads the document and returns the five fields as structured data, and Google Sheets logs the row. No typing, no copying, no mis-keyed figures.

Step 1: Catch the payslip in Gmail

In Make, add the Gmail module and set it to watch for new messages with a PDF attachment (demo file: payslip-nov-2026.pdf). When the monthly payslip arrives, the scenario starts itself.

Step 2: Let OpenAI extract the payslip fields

Add an OpenAI module and send it the PDF with one prompt: return the employee, pay period, gross pay, tax deducted, and net pay as structured fields. It returns the numbers — gross pay $5,000.00, tax deducted $1,150.00, net pay $3,850.00.

Step 3: Map each field to its Sheets column

Add a Google Sheets module (Add a Row) and map each extracted field to its column:

{
  "employee": "{{2.employee}}",
  "pay_period": "{{2.pay_period}}",
  "gross_pay": "{{2.gross_pay}}",
  "tax_deducted": "{{2.tax_deducted}}",
  "net_pay": "{{2.net_pay}}"
}
Enter fullscreen mode Exit fullscreen mode

Demo values: employee A Sharma, pay period November 2026, gross pay $5,000.00, tax deducted $1,150.00, net pay $3,850.00. The finished Sheet row reads: A Sharma | November 2026 | $5,000.00 | $1,150.00 | $3,850.00.

Step 4: Test it with the dummy payslip

Run the scenario once on the fictional demo payslip and check the Sheet row: $5,000.00, $1,150.00, $3,850.00. Five thousand minus one thousand one hundred fifty is three thousand eight hundred fifty — if the net pay does not match, check the extraction prompt first.

One Honest Limit

OpenAI reads the payslip as written, so if the PDF is a scanned image with smudged print, the extraction can misread a digit — always glance at the row before you rely on it. This logs payslips; it is not a payroll system.

Want the exact OpenAI extraction prompt from step 2? Reply PROMPT in the comments on the video.

Top comments (0)