The SharePoint Import input module takes the documents of a SharePoint library (SharePoint Online or an on-premise server) and adds them to a batch, with the PDF and e-mail options of the other import modules and, if you want, writes back the result in columns of the library. It works interactively from the Scan/Input tab and unattended from a hot folder task.
Requirements: a saved SharePoint connection (Administration tab, System panel, SharePoint Online Connections) with an account that can read the library, and write in it if you update columns or move and delete the imported files, and the .NET Framework 4.8 on the station, used by the connector that talks to SharePoint. The same connection is shared with the SharePoint export module.
Creating a configuration
In the Documents and Image Input toolbar of the Scan/Input tab select SharePoint Import and click Start Input. The window Import documents from SharePoint lists the available configurations; its menu offers New configuration, Copy configuration, Delete and List SharePoint libraries. The configurations are saved with the job and are the ones a hot folder task can choose. Each configuration has these groups of properties:
SharePoint Connection: the saved connection, or a server and a site (for example /sites/team) typed here.
Source: the Library (its title or its server relative URL; List SharePoint libraries reads the libraries of the site and fills it in), an optional Folder inside the library and Recursive to go down into its subfolders.
Filters: a SharePoint View, a Content type, a CAML Query (the ... button opens a visual builder with field, operator, type, value and ordering), the Allowed extensions separated by ; (empty means all), the Maximum SharePoint results asked to the server (0 = no limit) and the Maximum documents per session imported in one run or sweep (0 = no limit).
ChronoScan import options: Ignore PDF files with text (PDF files with a text layer are not imported), Ignore office files (only PDF and images are imported), Import emails (.eml and .msg files) and Do not import, only check and update fields in SharePoint, which runs the checks and writes the columns without creating documents. The PDF options (extraction mode, color and resolution, text extraction, attachments, original page and document, automatic orientation, password) are the ones of the Import PDF module, and the e-mail options (PDF with the body, attachments, inline images, one document per attachment) the ones of Importing e-mail.
Columns to update: the internal names of the library columns that receive the result: a status column with its values for processed, ignored and error (Processed, Ignored and Error by default), and columns for the number of pages, the number of words, whether the PDF has a text layer and a free information text.
After-action: what to do with the file in SharePoint once processed or ignored: nothing, move to a destination folder or delete.
Field mapping: pairs InternalName=ChronoScanField separated by ; that copy library columns into fields of the imported document. Every document also receives the system fields syssp.serverRelativeUrl, syssp.fileName, syssp.itemId, syssp.library and one syssp.prop.<InternalName> per column, available to scripts and output modules.
The buttons of the window: Start imports now into the open batch; Explore opens the library folder in the browser; View documents opens the SharePoint Document Browser, which runs the configuration and lists the files it would import (name, size, folder) with Search again and Edit field..., that sets a column to a value on all the listed files, for example to reset the status and import them again; Finish closes the window.
What happens in a run
The library is queried with the folder, view, content type and CAML filters and the result is filtered by extension. With Import emails off, .eml and .msg files are marked as ignored without being downloaded.
Each file is downloaded to a temporary folder and checked: PDF with text or office file to ignore, number of pages and words, text layer.
The file is imported with the PDF or e-mail options, the mapped columns are copied to the document fields and the status column is set to the processed value, with the pages, words, text layer and information columns if configured. A file that fails gets the error value.
The after-action moves or deletes the file in SharePoint. The ignored files get the ignored value and the after-action too, but their status is only written when it changes, so no new versions of the item are created at each sweep.
ChronoScan does not remember which files it has already imported: a file that still matches the query is imported again in the next run. Take the processed files out of the query with the status column and a CAML filter (for example <Where><Neq><FieldRef Name='Status'/><Value Type='Text'>Processed</Value></Neq></Where>), or with the after-action that moves them to another folder.
Hot folder
In the Tasks/HotFolder tab add a task with the module SharePoint Import and one of the configurations of the job (the ... button edits it). Batches are created one per sweep, or the documents are sent always to the same batch; the modes per folder and per file of the file import modules do not apply. The Run frequency of the task, in seconds, spaces out the queries to SharePoint so that the library is not asked on every pass of the engine; the rest of the options (processing on input finished, export, notifications) are the ones of any task, see HotFolder Tasks. In ChronoScan Enterprise the input server runs the same tasks.
The task log and the Output window record each sweep: the number of documents found by the query, the files downloaded or ignored, the column updates ("Item ... updated to Processed") and the connection errors returned by SharePoint. The connection and its credentials are stored as described in Where data and credentials are stored and Using Microsoft 365 Accounts (OAuth2).