Reads any PDF, lists every value it found in a Google Doc, and points out which ones to double-check against the original.
UsesExtend
Google 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 an Extend connection, which does the reading, and a Google Docs connection; the PDF; and a link to the Google Doc the results go in.
sourceFile to blank.Set sourceFile to blank.notebookDocument to blank.Set notebookDocument to blank.readingGuidance to blank.Set readingGuidance to blank.flagBelowConfidence to 0.7.Set flagBelowConfidence to 0.7.notebookDocument and save it as documentLink.Trim notebookDocument and save it as documentLink.notebookId to documentLink.Set notebookId to documentLink.documentLink contains /d/If documentLink contains /d/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.notebookId is emptyIf notebookId is emptyconfidenceFloor to flagBelowConfidence multiplied by 1.Set confidenceFloor to flagBelowConfidence multiplied by 1.reading.Extract data from a document. Save it as reading.readingGuidancereading.data to text and save it as recordJson.Convert reading.data to text and save it as recordJson.recordJson is {} or recordJson is nullIf recordJson is {} or recordJson is nullvaluesRead to 0.Set valuesRead to 0.valuesToCheck to 0.Set valuesToCheck to 0.valueLines to an empty list.Set valueLines to an empty list.checkLines to an empty list.Set checkLines to an empty list.coveredNames to an empty list.Set coveredNames to an empty list.readValue in reading.field_metadata:For each readValue in reading.field_metadata:readValue.field and save it as valueName.Trim readValue.field and save it as valueName.valueName is emptyIf valueName is emptyvaluesRead.Add 1 to valuesRead.valueName to the end of coveredNames and save it as coveredNames.Add valueName to the end of coveredNames and save it as coveredNames._ with in valueName and save it as fieldLabel.Replace _ with in valueName and save it as fieldLabel.valueName in a table and save it as valueFound.Look up valueName in a table and save it as valueFound.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.valueConfidence to readValue.confidence multiplied by 1.Set valueConfidence to readValue.confidence multiplied by 1.valueConfidence to 2 decimal places and save it as confidenceShown.Round valueConfidence to 2 decimal places and save it as confidenceShown.pageText to page readValue.page.Set pageText to page readValue.page.readValue.page is less than 1If readValue.page is less than 1pageText to page not given.Change pageText to page not given.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.valueConfidence is less than confidenceFloorIf valueConfidence is less than confidenceFloorvaluesToCheck.Add 1 to valuesToCheck.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.otherValues to reading.data.Set otherValues to reading.data.coveredNames isn't emptyIf coveredNames isn't emptycoveredNames from reading.data and save it as otherValues.Remove coveredNames from reading.data and save it as otherValues.otherNote to blank.Set otherNote to blank.otherValues as text is not {}If otherValues as text is not {}otherNote to Change otherNote to
Also read, with no page or confidence given, so check these too: otherValues.reading.file_name and save it as readTitle.Trim reading.file_name and save it as readTitle.readTitle is null or readTitle is emptyIf readTitle is null or readTitle is emptyreadTitle to Document.Change readTitle to Document.today.Get today's date and save it as today.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.valueLines with a new line and save it as valueList.Join valueLines with a new line and save it as valueList.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).valuesToCheck is greater than 0If valuesToCheck is greater than 0checkLines with a new line and save it as checkList.Join checkLines with a new line and save it as checkList.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.notebookId. Save it as added.Add text to notebookId. Save it as added.readTitle, read on readDate
valueList@otherNote
checkNotevaluesRead 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.