Skip to main content

How to write snips with a 3rd party application using the DataSnipper formula

Use DataSnipper formula tags (DS_SEARCH and DS_COORDS) to automatically create Snips from a 3rd party application when a workbook is opened in DataSnipper.

DataSnipper formula tags let you embed Snip instructions in an Excel workbook so that Snips are created automatically when the workbook is opened by someone with DataSnipper. This enables integration with 3rd party applications that can write to Excel files.

Any workbook whose filename ends in (ds) (for example, myworkbook(ds).xlsx) will be parsed by DataSnipper on open. Each cell containing a DataSnipper tag will trigger an automatic Snip. Documents without text will have OCR applied automatically if your organisation uses Text Recognition.

There are two types of DataSnipper tags: Search Tags and Coordinate Tags.

Snip from Search (DS_SEARCH)

Search tags create a Snip at every occurrence of a given search query on a page. Make your query as specific as possible, since every occurrence will be snipped.

Syntax:

DS_SEARCH[filename|pageNumber|query]

Parameters:

  • filename: absolute or relative filepath including extension

  • pageNumber: page number to search

  • query: the search term (number, date, word, or sentence)

Example: to snip all occurrences of "DataSnipper" on page 2 of invoice.pdf:

DS_SEARCH[invoice.pdf|2|DataSnipper]

Snip from Coordinates (DS_COORDS)

Coordinate tags create a Snip based on pixel coordinates on a page.

Syntax:

DS_COORDS[filename|pageNumber|x1|y1|x2|y2]

Parameters:

  • filename: absolute or relative path including extension

  • pageNumber: page number

  • x1, y1: pixel coordinates of the top-left corner of the Snip

  • x2, y2: pixel coordinates of the bottom-right corner of the Snip

Coordinates can be whole numbers (e.g. 5) or decimal numbers with a dot separator (e.g. 3.5).

File paths

Relative paths

A relative path is resolved from the folder containing the Excel workbook. Example:

PDFS\document.pdf

Use ..\ to navigate one directory up. Relative paths are recommended for most use cases as they work when workbooks and PDFs are shared together.

Absolute paths

An absolute path specifies the full location of the file. Example:

C:\Users\Username\Documents\DataSnipper\document.pdf

Absolute paths work well with Shared Network Drives. Ensure all users have the network drive mounted as the same drive letter (for example, N: for everyone).

Tip: when sharing workbooks that use relative paths, bundle the Excel file and PDF documents together in a .zip archive to preserve the relative path structure.

Did this answer your question?