# Data Sources

<figure><img src="/files/brVqWNp5KTSs85btE5th" alt=""><figcaption></figcaption></figure>

`Data Source` is exactly that - a source of data you configure to read/write data from, or a source of data with an add-in to push data to SharpSync.&#x20;

A primary source will be a Bill of Materials (BOM) structure and metadata (e.g., part number, description, revision). A secondary source will be Inventory records and BOM data.

Each source may be registered as either a *Primary* or a *Secondary* Data Source.&#x20;

It works as follows:

* *Primary Data Source* ↔️ SharpSync ↔️ S*econdary Data Source*

### Core concept: Sources

* A *Primary* Data Source is typically a CAD / PDM / PLM source. It is the origin of your CAD data.
* A S*econdary* Data Source is typically an ERP / MRP source.
* SharpSync uses both sources to do bi-directional synchronization, meaning it pulls information from the *Primary* and writes to the *Secondary*. It can also pull information from the *Secondary* and write to the *Primary*.
* Currently the application is limited to a single *Primary* source and a single *Secondary* source.

### Core concept: Primary and Alternative Component Identifiers

SharpSync is a synchronization tool. It synchronizes data between two Data Sources. To do this, it uses the following two parameters:

* Primary Component Identifier: The preferred property or meta data name to search
* Alternative Component Identifier: The alternative property or meta data name to search if the primary returns an empty result.

A Primary (or alternative) component identifier is the meta data, part number or custom property that uniquely identifies the component item (part, assembly, item or drawing) in a Data Source.

Typically this property (in a CAD environment) would be something like `Number`, `PartNumber`, `No`, `PartNo.`  or similar.

Typically in an ERP system, this would be something like `Number`, `PartNo`, `ItemId`, `Id` or similar.

{% hint style="warning" %}
\*\*\* SharpSync's internal usage of component identifiers varies between sources. Some CAD or ERP sources are more restrictive and limit SharpSync to use the default source identifier.
{% endhint %}

**Example With Onshape**

Let's say we're working with a part called '123'. Our primary identifier is `'PartNumber'` and our alternative identifier is `'name'.`

The way SharpSync works is that it searches the source for the *Primary* identifier (in this case the primary identifier is `PartNumber`). So it  searches the source for a component identifier  `PartNumber` with a value of `123.`&#x20;

If nothing is found using an exact match (i.e. no component identifier `PartNumber` with a value of `123`), it will search the source using the *Alternative Component Identifier*. In this case, the alternative identifier is`name`, so the source is searched for a component identifier `name` with a value of `123`.

As an example of a Primary Identifier, we have included a screenshot from OnShape. This will of course vary from other platforms:

<figure><img src="/files/dE4Lgu4eHePninONDnEz" alt="" width="563"><figcaption><p>OnShape Property Map</p></figcaption></figure>

Onshape primary identifier can be set with dynamic parts in SharpSync, for example:

```
{partNumber}-R{revision}
```

will assign a component name built from the `partNumber` and `revision` fields if mapped in the property mapping as Onshape fields (example `P123-R01` ).

Onshape primary identifier can be set with conditional dynamic parts in SharpSync, for example (equality):

```
{partNumber}{-R|category==CUSTOM}{revision|category==CUSTOM}
```

will assign `P123-R01`  if the `category` field is equal to `CUSTOM`  and `P123`  if not.

or (non equality)

```
{partNumber}{-R|category!=CUSTOM}{revision|category!=CUSTOM}
```

will assign `P123-R01`  if the `category` field is not equal to `CUSTOM`  and `P123`  if it is.

### Core concept: Bom Revision Names

In the Configuration section of a Secondary Source (Typically an ERP), you will find a BOM Revision Scheme field where a naming convention must be specified for BOM revisions.

Some examples may be:

<table><thead><tr><th width="504">Scheme name</th><th>Sample result</th></tr></thead><tbody><tr><td>{rowData.componentName}</td><td>A1</td></tr><tr><td>{rowData.componentName}_BOM</td><td>A1_BOM</td></tr><tr><td>{rowData.componentName}_{rowData.cells.revision}</td><td>A1_A or A1_B</td></tr></tbody></table>

<figure><img src="/files/H90Q6PGnHuvDCs6H116d" alt=""><figcaption><p>Set the schema name. Use curly braces {} to capture dynamic fields from the row data</p></figcaption></figure>

Some ERPs allows the management of different Bills of Materials for the same assembly at different stages of the design process, typically when a new revision occurs. To facilitate this, a scheme name has to be specified.

In the example above, the name of the component may be used. In addition to this, you can use any [Accessor](/sharpsync/fundamentals/property-mappings.md) Name from a [Property Mapping](/sharpsync/fundamentals/property-mappings.md) to get dynamic values.

What's important here is that, when specifying this Schema name, you should *not* map the value in a property mapping. In other words, do not map the BOM Name or Code in a Property Mapping (you *can*, but you *shouldn't*). This is because, when not finding a BOM with a matching name, a *new* BOM will be created, which is not what you'd want.

### Core concepts: Setup

To complete a Data Source's setup, you have to complete at least the following two items:

* Setup authentication
* Setup BOM configuration

### Resource links

Select an individual Data Source to view the configuration setup for that source.

<table data-full-width="false"><thead><tr><th width="317">Name</th><th width="108">Type</th><th width="119">Source</th><th>Sync</th><th>Status</th><th data-hidden>Documentation</th></tr></thead><tbody><tr><td><a href="/pages/5ZTATO09kjkNpHTUhvNF">AutoDesk Inventor</a></td><td>CAD</td><td>Primary</td><td>➡️</td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td>Documentation</td></tr><tr><td><a href="/pages/HwjFJ9SOKwrIQPPOXEtm">AutoDesk Fusion</a></td><td>CAD</td><td>Primary</td><td>➡️</td><td>[Alpha]</td><td></td></tr><tr><td><a href="/pages/cEHgDv7NGBquDGHeLyQ4">CSV</a></td><td>Offline</td><td>Primary</td><td>➡️</td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td>Documentation</td></tr><tr><td><a href="/pages/emjeA2nZzRfCerDCO8WY">MS Dynamics 365 Business Central</a></td><td>ERP</td><td>Secondary</td><td>⬅️ ➡️️</td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td>Documentation</td></tr><tr><td><a href="/pages/XmuhfuUwSckATArsaGDO">NetSuite</a></td><td>ERP</td><td>Secondary</td><td>⬅️ ➡️️</td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td>Documentation</td></tr><tr><td><a href="/pages/8zpS2ToBrjPMH8Z34eTX">Odoo</a></td><td>ERP</td><td>Secondary</td><td>⬅️ ➡️️</td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td>Documentation</td></tr><tr><td><a href="/pages/ncWXBabW9o1vIKQltJMo">Onshape</a></td><td>CAD</td><td>Primary</td><td>⬅️ ➡️️</td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td>Documentation</td></tr><tr><td><a href="/pages/wa16DgU3Z7ZmXMxouqJB">Propel PLM</a></td><td>ERP/PLM</td><td>Secondary</td><td>⬅️ ➡️️</td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td>Documentation</td></tr><tr><td><a href="/pages/ZVm3HTdTvDomstiungQl">SOLIDWORKS</a></td><td>CAD</td><td>Primary</td><td>➡️</td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td>Documentation</td></tr><tr><td><a href="/pages/UYYAvt3zCTDbgBzDtb2A">SOLIDWORKS PDM</a></td><td>PDM</td><td>Primary</td><td>⬅️ ➡️️</td><td><span data-gb-custom-inline data-tag="emoji" data-code="2705">✅</span></td><td>Documentation</td></tr></tbody></table>

{% hint style="info" %}
If you want a primary offline CAD source to sync both ways (SolidWorks, Inventor, CSV), please contact us for a custom implementation
{% endhint %}

See also [Troubleshooting](https://github.com/SharpSync/docs/blob/main/datasources/troubleshooting_datasources.md)

### Row Component Rules

SharpSync has the ability to generate additional rows based on rules.

You might ask yourself why this would be needed.

When certain types of BOM items are loaded, let's say a SheetMetal part, you'll want to consume the raw material for said part. The problem is that this raw material is not modelled in the CAD system. But you still need to add it as a consumable item below the part document.

Another use may be that you require raw material for casted components. The situations may vary but the concept is the same across the board - you need some kind of item created as a child of a part or assembly document.

For this we introduce pre-BOM-load generation rules, or *Row Component* rules. These rules run:

* *After* the BOM is generated in the Primary Datasource, but&#x20;
* *Before* the BOM is displayed on-screen. This is different to the client-side rules (Property Mapping Rules), which only run per-source, *after* the BOM is displayed on-screen.

Data Source support for server-side rules is currently only available for data source Onshape.

### Technical detail

See the Advanced Configuration Page on [Row Component Rules](/sharpsync/advanced/row-component-rules.md) for technical detail on how to manage rules.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sharpsync.gitbook.io/sharpsync/fundamentals/data-sources.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
