Reads any PDF, lists every value it found in a Google Doc, and points out which ones to double-check against the original.

UsesExtendGoogle Docs

Pull every value out of a PDF and flag what to check

Give it one PDF, such as a form, a spec sheet, a statement of work or a scanned report, and run it whenever you want everything in it written down value by value. The whole file is read in one pass, and the document's own layout decides what the values are unless you say what it is and how you want it read. Each value goes into your Google Doc on its own line, with the page it was found on and how confident the reading was.

Values are written as they were read: nothing is completed, tidied up or filled in from elsewhere. Any value read less confidently than the level you choose is listed again at the end of the section, by name and page, so you know exactly what to check against the original. Every run adds a new section headed with the file name and the date, so nothing already in the Doc is changed. If nothing can be read from the file, the run stops and writes nothing.

You need Extend, which does the reading, and Google Docs connected; the PDF; and a link to the Google Doc the results go in.

Set sourceFile to blank.Set sourceFile to blank.
Set notebookDocument to blank.Set notebookDocument to blank.
Set readingGuidance to blank.Set readingGuidance to blank.
Set flagBelowConfidence to 0.7.Set flagBelowConfidence to 0.7.
Trim notebookDocument and save it as documentLink.Trim notebookDocument and save it as documentLink.
Set notebookId to documentLink.Set notebookId to documentLink.
If documentLink contains “/d/”If documentLink contains “/d/”
Yes
Get the first item of the last item of documentLink split by “/d/” split by “/” and save it as notebookId.Get the first item of the last item of documentLink split by “/d/” split by “/” and save it as notebookId.
Else if @documentLink contains "/"
Stop and report a problem: The 'notebookDocument' step does not look like a Google Docs link. Paste the link from the address bar while the document is open, or paste just its document id.Stop and report a problem: The 'notebookDocument' step does not look like a Google Docs link. Paste the link from the address bar while the document is open, or paste just its document id.
Otherwise
No steps
If notebookId is emptyIf notebookId is empty
Yes
Stop and report a problem: No document id could be read out of the 'notebookDocument' step. Paste the link from the address bar while the document is open.Stop and report a problem: No document id could be read out of the 'notebookDocument' step. Paste the link from the address bar while the document is open.
No
No steps
Set confidenceFloor to flagBelowConfidence multiplied by 1.Set confidenceFloor to flagBelowConfidence multiplied by 1.
ExtendExtendExtract data from a document. Save it as reading.Extract data from a document. Save it as reading.readingGuidance
Convert reading.data to text and save it as recordJson.Convert reading.data to text and save it as recordJson.
If recordJson is “{}” or recordJson is “null”If recordJson is “{}” or recordJson is “null”
Yes
Stop and report a problem: Nothing could be read out of that document, so nothing was written. Check the file opens as a PDF or an image, and describe what it is in the 'readingGuidance' step to help the read along.Stop and report a problem: Nothing could be read out of that document, so nothing was written. Check the file opens as a PDF or an image, and describe what it is in the 'readingGuidance' step to help the read along.
No
No steps
Set valuesRead to 0.Set valuesRead to 0.
Set valuesToCheck to 0.Set valuesToCheck to 0.
Set valueLines to an empty list.Set valueLines to an empty list.
Set checkLines to an empty list.Set checkLines to an empty list.
Set coveredNames to an empty list.Set coveredNames to an empty list.
For each readValue in reading.field_metadata:For each readValue in reading.field_metadata:
Trim readValue.field and save it as valueName.Trim readValue.field and save it as valueName.
If valueName is emptyIf valueName is empty
Yes
Skip to the next item.Skip to the next item.
No
No steps
Add 1 to valuesRead.Add 1 to valuesRead.
Add valueName to the end of coveredNames and save it as coveredNames.Add valueName to the end of coveredNames and save it as coveredNames.
Replace “_” with “ ” in valueName and save it as fieldLabel.Replace “_” with “ ” in valueName and save it as fieldLabel.
Look up valueName in a table and save it as valueFound.Look up valueName in a table and save it as valueFound.
Use valueFound, or “(left blank)” if it is empty and save it as valueText.Use valueFound, or “(left blank)” if it is empty and save it as valueText.
Set valueConfidence to readValue.confidence multiplied by 1.Set valueConfidence to readValue.confidence multiplied by 1.
Round valueConfidence to 2 decimal places and save it as confidenceShown.Round valueConfidence to 2 decimal places and save it as confidenceShown.
Set pageText to “page readValue.page”.Set pageText to “page readValue.page”.
If readValue.page is less than 1If readValue.page is less than 1
Yes
Change pageText to “page not given”.Change pageText to “page not given”.
No
No steps
Add fieldLabel: valueText (pageText, confidence confidenceShown) to the end of valueLines and save it as valueLines.Add fieldLabel: valueText (pageText, confidence confidenceShown) to the end of valueLines and save it as valueLines.
If valueConfidence is less than confidenceFloorIf valueConfidence is less than confidenceFloor
Yes
Add 1 to valuesToCheck.Add 1 to valuesToCheck.
Add - fieldLabel (pageText) to the end of checkLines and save it as checkLines.Add - fieldLabel (pageText) to the end of checkLines and save it as checkLines.
No
No steps
Set otherValues to reading.data.Set otherValues to reading.data.
If coveredNames isn't emptyIf coveredNames isn't empty
Yes
Remove coveredNames from reading.data and save it as otherValues.Remove coveredNames from reading.data and save it as otherValues.
No
No steps
Set otherNote to blank.Set otherNote to blank.
If otherValues as text is not “{}”If otherValues as text is not “{}”
Yes
Change otherNote to Change otherNote to Also read, with no page or confidence given, so check these too: otherValues.
No
No steps
Trim reading.file_name and save it as readTitle.Trim reading.file_name and save it as readTitle.
If readTitle is “null” or readTitle is emptyIf readTitle is “null” or readTitle is empty
Yes
Change readTitle to “Document”.Change readTitle to “Document”.
No
No steps
Get today's date and save it as today.Get today's date and save it as today.
Make today readable as “Monday, November 2, 2026” and save it as readDate.Make today readable as “Monday, November 2, 2026” and save it as readDate.
Join valueLines with a new line and save it as valueList.Join valueLines with a new line and save it as valueList.
Set checkNote to “Every value was read at or above the confidence you set (flagBelowConfidence).”.Set checkNote to “Every value was read at or above the confidence you set (flagBelowConfidence).”.
If valuesToCheck is greater than 0If valuesToCheck is greater than 0
Yes
Join checkLines with a new line and save it as checkList.Join checkLines with a new line and save it as checkList.
Build the text “Check these against the original: @valuesToCheck of @valuesRead values were read below the confidence you set (@flagBelowConfidence): @checkList” and save it as checkNote.Build the text “Check these against the original: @valuesToCheck of @valuesRead values were read below the confidence you set (@flagBelowConfidence): @checkList” and save it as checkNote.
No
No steps
Google DocsGoogle DocsAdd text to notebookId. Save it as added.Add text to notebookId. Save it as added.readTitle, read on readDate valueList@otherNote checkNote
Finish the run: Read valuesRead values out of readTitle and added them to your Google Doc. Values to check: valuesToCheck.Finish the run: Read valuesRead values out of readTitle and added them to your Google Doc. Values to check: valuesToCheck.