Skip to main content

File Paradigm

The file paradigm is a pattern in Lido that enables your spreadsheet to operate on files. It has two sides:

  • File source formulas tell Lido where to read input files from — so you can pass them to formulas like OCRMYPDF, GPTVISION, EXTRACTTEXT, etc.
  • File destination formulas tell Lido where to write output files to — a Google Drive folder, a OneDrive folder, a browser download, or temporary storage.

File Source Formulas

A file source formula resolves a file reference into something Lido can read. You pass the result to any formula that accepts a file input.

FormulaDescription
GOOGLEDRIVEFILE(credential, url)Resolves a file from Google Drive
ONEDRIVEFILE(credential, url)Resolves a file from OneDrive
PUBLICURLFILE(url)Resolves a file from a public URL (no credential needed)
OUTLOOKATTACHMENT(...)Resolves an Outlook email attachment
TEMPORARYFILE(id)Resolves a file from temporary storage (see below)

Example

=OCRMYPDF(GOOGLEDRIVEFILE(cred, "https://drive.google.com/file/d/..."), "eng", B2)
=GPTVISION(PUBLICURLFILE("https://example.com/image.png"), cred, "Describe this image", C2)

File Destination Formulas

A file destination formula tells Lido where to put a newly created or copied file. You pass the result to the destination parameter of formulas like COPYFILE, CREATEPDF, EXPORTWORKSHEETSASEXCEL, etc.

FormulaDescription
GOOGLEDRIVEUPLOAD(credential, [folder], [make_public])Upload to a Google Drive folder
ONEDRIVEUPLOAD(credential, [folder], [make_public])Upload to a OneDrive folder
FILEDESTINATIONDOWNLOAD()Download to the user's browser
TEMPORARYFILESTORE()Store in temporary storage for use by other formulas

Example

=CREATEPDF(cred, "Invoice Template", B2, content, data, FALSE, GOOGLEDRIVEUPLOAD(drive_cred, "https://drive.google.com/drive/folders/..."))
=COPYFILE(GOOGLEDRIVEFILE(cred, url), FILEDESTINATIONDOWNLOAD())

Temporary Storage

Temporary storage is the key to chaining file operations. When a formula produces a file, you can store it in temporary storage with TEMPORARYFILESTORE() instead of uploading it to cloud storage or downloading it. The resulting file can then be referenced with TEMPORARYFILE(id) and passed to another formula as input.

This is especially useful when you need to process a file through multiple steps — for example, OCR a PDF, then extract text, then pass it to an AI model — without needing to upload intermediate results to Google Drive.

Example: Multi-step file processing

Step 1: OCR a scanned PDF and store result in temporary storage
=OCRMYPDF(GOOGLEDRIVEFILE(cred, Invoices[@Link]), "eng", B2, TEMPORARYFILESTORE())

Step 2: Extract text from the OCR'd PDF (reading from temporary storage)
=EXTRACTTEXT(TEMPORARYFILE(B2), C2)

Step 3: Pass extracted text to AI
=GPT(openai_cred, "Summarize this invoice: " & C2, D2)

Without temporary storage, you would need to upload the OCR'd PDF to Google Drive after step 1 and read it back in step 2. Temporary storage avoids this round-trip.

Using Files in Tables

When a DATASET is configured with a file column (typically named "Link"), each row in the resulting table corresponds to a file. This makes it easy to apply file operations across many files using computed columns:

=MAKETABLE(DATASET('~drive_invoices'!$A$1:$E$5), "Invoices")
=COMPUTEDCOLUMN(EXTRACTTEXT(GOOGLEDRIVEFILE(cred, Invoices[@Link]), B2), "Invoices", "Text")
=COMPUTEDCOLUMN(GPTVISION(GOOGLEDRIVEFILE(cred, Invoices[@Link]), openai_cred, "Summarize", C2), "Invoices", "Summary")

File Column Configuration

A DATASET has file support when:

  1. The data source returns a column containing file URLs or identifiers
  2. The column is mapped to a "Link" field in the dataset configuration
  3. The fileSource is set to googleDrive or onedrive

When Lido detects this pattern, it knows how to authenticate and access each file referenced in the Link column.

Tips

  • Keep configuration sheets (~ prefixed) untouched — they are managed by Lido
  • Use TEMPORARYFILESTORE() for intermediate files in multi-step pipelines to avoid unnecessary cloud storage round-trips
  • Use FILEDESTINATIONDOWNLOAD() when the end user should receive the file directly in their browser
  • For Google Drive and OneDrive, Lido handles authentication automatically using your connected account credentials
  • Combine file sources with AI formulas (GPTVISION, CLAUDE, GEMINI) to build document processing pipelines