Lens

Export a Table to SFTP

An export delivers the rows of one Lens table to an SFTP server on a schedule, as CSV, TSV or JSONL files, so other systems can pick them up.

Before you start

You need an SFTP connection saved under Security & Access, and a synced Lens table to export. SFTP is the only destination today.

Create the export

  1. Go to Configure > Exports and click Add Export.
  2. Under Source and destination, enter an Export Name, pick the Source Table and the SFTP Connection, and set the Remote Path (the folder on the server).
  3. Set the File Name Pattern. It can use {table}, {date}, {datetime}, {part} and {ext}. The default is {table}_{date}{part}.{ext}.
  4. Choose what to export, the file format and the schedule (below).
  5. Click Add Export.

What to export

ModeSends
FullEvery row in the table on each run
IncrementalOnly rows newer than the last run, plus an Incremental Overlap (1 day by default) so late-arriving rows are not missed

Set a Dedup key column if the receiving system needs one row per key. Under Row shaping, you can explode a JSON array column into one row per element; that needs a Column map, which sets the output columns, their order and their headers.

File format

SettingOptions
FormatCSV, TSV or JSONL
DelimiterFor CSV and TSV
Header rowOn or off
CompressionNone or gzip
Split into files of at mostA row count; each part fills {part} in the file name

Delivery safety

So the receiving system never reads a half-written file, pick an Atomic strategy:

StrategyHow it works
Temp then rename (default)Uploads under a temporary suffix, then renames the file when it is complete
Sentinel fileUploads the data file, then a matching .fin file to signal it is ready
NoneUploads straight to the final name

Schedule

Exports run manually, hourly, every 4, 6 or 12 hours, daily (06:00 by default) or weekly on the days you choose. Times use your property's time zone unless you pick another.

Export after the sync

Schedule the export to run after the table's own sync, so each file carries the newest data.

Check that it ran

Each export keeps its last 20 runs under Run History, with the status and any error. The Exports list shows each export's current status.

Failed exports pause after five tries

After five failures in a row, an export stops running on its schedule. Saving the export, or a successful manual run, clears the count and restarts the schedule. Failure emails are not sent yet, so check the Exports list status, especially after changing SFTP credentials.

Troubleshooting

The export shows an error after a credentials change

Update the SFTP connection under Security & Access, open the export and save it, then run it manually to confirm the fix.

The receiving system sees duplicate rows

Incremental mode overlaps the previous run by one day on purpose. Set a Dedup key column, or have the receiving system upsert on a key.