The released filename is the part number plus the revision. The destination folder depends on a project code in the ERP database. The material on a drawing stamp lives in a SQL table nobody wants to retype as a property. External Sources and Advanced Formulas are the two shared resources that make those values available anywhere PDMPublisher names a file, picks a folder or fills a property.
In short
- An External Source is one SELECT statement against SQL Server with parameters mapped to document values; its result can be inserted into filenames, folders, properties and annotations.
- An Advanced Formula is a named expression built from functions, properties and sources, reused across every profile.
- Credentials stay local: they never travel with exports, PIN shares or Company Settings.
How it works

- Under PDMPublisher > Settings > External Sources, add a source: a connection, one SELECT statement, parameters such as
@Configurationmapped to document fields, and the result column to use. Test it. - Under Advanced Formulas, name a formula and type the expression; insert functions and sources from the arrow menu and check it with Evaluate.
- Insert the source or formula from the arrow menu of any filename, folder, property or annotation box.
- Values are resolved when the job runs, for the document each row belongs to.

Settings that matter
| Setting | What to put | Why |
|---|---|---|
| Parameters | @Configuration mapped to the configuration name, say | The query runs per document row with that row’s values. |
| Choose columns | The one result column to use | A query that returns several columns still yields one value. |
| Formula name | Released filename, say | Inserted by name; change it once and every profile follows. |
| Export all settings | Before a broad change | One shared formula can affect several profiles; keep a bundle to go back to. |

Recipes
| You want | Set | You get |
|---|---|---|
| Material from ERP in Property Doctor | Source SELECT Material FROM PartProperties WHERE Configuration = @Configuration; fill the Material column from the External source submenu | Materials filled from the database, previewed before Apply. |
| One released filename for every copy | Formula {PartNumber}-{Revision} inserted in Publish and Save As New | Every output and copy named the same way. |
| A destination folder per project code | Source returning the project folder for @ProjectNumber, inserted in Export location | Files filed where the ERP says they belong. |
If something looks wrong
- The query test succeeds but the document gets an empty value: a parameter is mapped to a field that is empty for that document.
- After importing a configuration, sources fail: re-enter the credentials; they are never included in exports.
- A formula evaluates differently in a profile: it is resolved for the document row where it is applied; check the row.
- The functions list seems incomplete: there is no fixed list; the arrow menu shows what the current build supports.
Availability
External Sources and Advanced Formulas is part of PDMPublisher for SOLIDWORKS, the add-in that runs inside SOLIDWORKS. They are shared resources of the add-in; the PDM task has its own SQL query placeholders for annotations.
Keep going
Documentation
Frequently asked questions
Can PDMPublisher read values from a SQL Server database?
Yes. Define an External Source under Settings > Shared Resources > External Sources with a connection string, one SELECT statement and parameters mapped to document fields. The source then appears in the External source submenu of supported property, formula, filename and folder menus.
What is an Advanced Formula in PDMPublisher for SOLIDWORKS?
A named equation, such as =FilenameWithoutExtension, that is evaluated for the document and configuration being processed. Formulas are inserted by name into Save As New, Clone Tree, Property Doctor and supported publishing templates, so one definition drives every workflow.
Are SQL passwords included when I export or share settings?
No. Connection strings are protected for your Windows account and are excluded from settings bundles, PIN shares and Company Settings. Re-enter them on the destination computer after importing.
What is the difference between an External Source and an annotation SQL query?
An External Source is a reusable definition available to property, filename and folder menus in the SOLIDWORKS add-in. An annotation SQL query is configured inside a Publish profile’s annotation with the ($SQL-Filename), ($SQL-Part), ($SQL-Assembly) and ($SQL-Drawing) placeholders and travels with that profile.
Why does my query test succeed but the document gets an empty value?
A successful connection does not guarantee that every document returns a row. Check the parameter mapping and the value the document actually supplies, and define the expected empty-result behavior in the consuming workflow.
Where is the list of formula functions?
The functions and sources available on your installation are listed in the arrow and right-click menus of the Value / Equation cell in the formula editor. Use the Sample input field and the Evaluates to column to preview the result before saving.