# Photos in, data out: forms, receipts, whiteboards

A 19-minute routine for turning a photo of a receipt, form or whiteboard into a table: transcribe first, extract second, then check the sums outside the model and read every number that matters against the photo.

Workflows · v1.1 · draft · https://hayzlabs.com/workflows/photos-in-data-out/

In short:
- Take a flat, well-lit photo, ask for an exact transcription with unreadable parts marked, then ask for a table.
- Check the sums in a spreadsheet, not in the model, against the printed total on the photo.
- Read every total, date and name that matters against the photo before you file the table.

**Use it when** you have a paper receipt, a form, a label or a whiteboard and want its contents as rows in a spreadsheet.

**Not when** a small error would cost something and you have no time to check each field. Typing it yourself is then faster than checking a bad extraction.

**You need** a phone camera, a spreadsheet, an assistant that accepts images and about 19 minutes for one receipt. Cover or crop card numbers and ID numbers before you share a photo: [What not to paste](https://hayzlabs.com/start/what-not-to-paste/).

## Steps

The steps and times are our suggestion.

| # | Step | Who | Time | Check |
|---|---|---|---|---|
| 1 | Decide what you want out: the columns of the table, and what a mistake would cost. | Person | 3 min | You can name each column. **If it fails:** you do not yet know what the photo is for. |
| 2 | Take the photo: flat and upright with no curl, filling the frame, in even light with no glare on the totals, one document per photo. | Person | 2 min | You can read every figure at full zoom yourself. **If it fails:** retake the photo. |
| 3 | Ask the assistant to transcribe the photo exactly and to mark anything it cannot read. | AI | 2 min | The number of lines it reports equals the number you count, and unreadable items are marked and not filled in. **If it fails:** retake the photo, or crop to the part that failed. |
| 4 | Ask for the transcription as a table with your columns. | AI | 2 min | Every cell comes from a transcribed line, and empty cells are listed. |
| 5 | Paste the table into a spreadsheet and check the sums there: the lines plus tax and tip against the printed total. | Person | 3 min | The difference is 0. **If it fails:** find the line that is off by the difference, and read it on the photo. |
| 6 | Read every number that matters against the photo, starting with totals, dates and names. | Person | 5 min | Each one is matched. **If it fails:** correct it by hand. If more than two values were missing, retake the photo before you try another prompt. |
| 7 | File the table with the photo's file name and today's date. | Person | 2 min | The table, the photo name and the date sit together. |

> [!CHECK]
> Step 5 is the gate. A model that misreads a number can still give a tidy table, and only the arithmetic shows it. A model may also adjust a printed total to match its own sum, so read the total on the photo and not only in the table.

## The prompts

For step 3, attach the photo and paste this:

```text title="Transcribe exactly · v1.0"
This photo shows <DOCUMENT_TYPE>. Transcribe it exactly, line by line, in
the same order and layout. Copy every number, date and name as printed. Do
not correct, calculate or tidy anything. If you cannot read something, write
[?] in its place and do not guess. At the end, say how many lines you read
and list every [?].
```

Replace the following:
- `<DOCUMENT_TYPE>`: a shop receipt, a paper form, a label or a whiteboard.

For step 4, in the same chat:

```text title="Transcription to table · v1.0"
Use only the transcription below. Make a table with these columns:
<COLUMNS>
Copy values exactly as transcribed. Leave a cell empty when the transcription
has no value for it, and list every empty cell at the end. Do not add up,
work out or fill in any figure.
Transcription:
<TRANSCRIPTION>
```

Replace the following:
- `<COLUMNS>`: your columns from step 1, such as `date, shop, item, quantity, amount`.
- `<TRANSCRIPTION>`: the transcription from step 3, with the `[?]` marks left in.

For step 5, put this in a spare cell of the spreadsheet:

```text title="Sum check for a receipt · v1.0"
=ROUND(SUM(<LINE_AMOUNTS>)+<TAX_CELL>+<TIP_CELL>-<PRINTED_TOTAL_CELL>,2)
```

Replace the following:
- `<LINE_AMOUNTS>`: the range holding the line amounts, such as `D2:D5`.
- `<TAX_CELL>`, `<TIP_CELL>` and `<PRINTED_TOTAL_CELL>`: the cells holding the tax, the tip and the printed total, such as `D6`, `D7` and `D8`. Use `0` if there is no tip.

A result of 0 means the lines add up to the printed total.

## A worked example (illustrative)

Femi photographs a shop receipt with four lines: 12.50, 8.75, 3.20 and 4.40. Tax is 2.31 and the printed total is 31.16. The lines add up to 28.85, and with tax that is 31.16, so the check cell reads 0. If the model had read 8.75 as 6.75, the lines and tax would add up to 29.16 against a printed 31.16. The check cell would show minus 2.00, which tells Femi to look for a line that was read 2.00 too low. The numbers are invented.

## How to tell it worked

- The check cell reads 0, and you matched each total, date and name to the photo.
- The table keeps the file name of the photo, so you can find the source later.
- It has failed if the sums are off and you accepted the table anyway. Go back to step 6.

## Variations

- **A whiteboard.** Step 4 becomes `owner | action | due date`, with a date only where one is written, and every `[?]` listed. Read every item if the actions will be given to people.
- **A paper form.** Do step 6 for every field before you submit. For tax, medical and legal forms, a qualified person decides what the form means.

## Limits

> [!LIMIT]
> The routine will not catch an error that keeps the sums right, such as a misread item name or two wrong digits that cancel out, which is what step 6 is for. It does not make a photo of a form safe to submit unread.

OpenAI's help page for data analysis warns that ChatGPT "may not reliably extract exact values from image-based tables, scanned files, or files with complex visual layouts" ([OpenAI help](https://help.openai.com/en/articles/8437071-data-analysis-with-chatgpt), vendor documentation). That is why step 6 reads each number that matters.

## Sources

1. OpenAI, Help page: Data analysis with ChatGPT. Vendor documentation. [Link](https://help.openai.com/en/articles/8437071-data-analysis-with-chatgpt).
