Create Teamcenter elements based on data from Excel sheet
This example pipeline demonstrates how to read the metadata of Teamcenter elements from an Excel sheet and create those elements in Teamcenter.

Steps
1: An Excel file contains metadata from various Teamcenter elements. The Excel file is to be imported via a pipeline. The elements are to be created in Teamcenter using Teamcenter Snap (Create and Update). The Teamcenter data object_type, item_id, item_revision_id, and UID are to be written back to a file for the newly created elements.

For the pipelines purpose this file will be uploaded and stored at SnapLogic.

As a first step a new pipeline has to be created.

2: First step in the pipeline will the read operation of the file. Here we utilize the File Reader Snap.

This Snap is creating a binary stream which is needed to be processed now.
3: It will be read by an Excel Parser to create a JSON document stream in the pipeline. Since the Excel sheet has a header row and the sheet is named as 'Data', the appropriate setting in the Snap is done.
Snap configuration | Snap output |
|---|---|
![]() | |
As a result we will get a JSON representation of the sheet content. In order to create elements in Teamcenter the Snap 'Tc Create and Update' can be used. This Snap is able to create all kind of Teamcenter elements derived from type Item. A specific feature of Teamcenter is that not all properties of an element can necessarily be handled with the Create function. Therefore, it may be necessary to perform an update after Create to ensure that the data is transferred completely. This snap has the smart feature of automatically executing the corresponding update function.
Exctract to explain Tc Snap: In addition, executing a Teamcenter Snap always requires the definition (setting) of an account.

To create an element in Teamcenter, you must specify the type (1) of element (object_type) and the minimum values for all mandatory entries of that type. The corresponding fields in the snap must be provided with the inputs.

The properties (object attributes) can be transferred as a document key or individually as rows in an attribute table. The more generic approach is to use a document key that then contains attributes and values (2).
In this case the expected JSON document shall have following keys:
key | purpose | example |
|---|---|---|
object_type | A JSON string to specify the Teamcenter object_type value of the element to be created. | “object_type“: “Item“ |
attributes | A JSON document key, which will contain pairs of Teamcenter property name and values. | “attributes”:{ “object_name” : “the name“, “object_desc“ : “the_desc“ } |
The snap setting is done like

On field Object type the expression value $object_type is set. This will refer to the JSON key object_type in the JSON input document.
On field Object attributes path the expression value $attributes is set. This refers to the key attributes in the JSON input document.
4: To generate the so-called createable JSON document, the JSON document of the Excel parser must be mapped to the necessary Teamcenter Create input. This is done using the Mapper Snap.
Snap configuration | Snap output |
|---|---|
![]() | |
The values from Type column are to be mapped to key object_type.
The values from Name column are to be mapped to key attributes.object_name.
The values from Description column are to be mapped to key attributes.object_desc.
5: Last step is connecting the Teamcenter Create and Update Snap with the Mapping output.

In order to specify the amount of data output provided by Teamcenter it is possible to utilize the 'Configure output' option of the Tc Snaps.
In this specific case the following list of Teamcenter properties shall be provided:
Property description | Value |
|---|---|
The Id of the Teamcenter element which has been created. | item_id |
The Revision Id of the Teamcenter element. | item_revision_id |
The Teamcenter internal database Id of the created revision. | UID |
The Display name of the element in teamcenter. | object_string |
The type of the element in teamcenter. | object_type |
The description of the element in teamcenter. | object_desc |
The name of the element in teamcenter. | object_name |
In the snap setting the option ‘Return revision' needs to be activated and the attribute values for the list of expand attributes needs to be set below active option for 'Configure output’.
The Teamcenter and Adapter internal unique key values, the _id and the UID are always part of the output, regardles of the configured values.
Snap configuration | Snap output |
|---|---|
![]() | |
6: To be able to write an excel file including the Temcenter information this data has to be transformed. Again this is done using the Mapper Snap.
The values from object_type are to be mapped to Type property.
The values from object_name are to be mapped to Name property.
The values from object_desc are to be mapped to Description property.
The values from item_id are to be mapped to ID property.
The values from item_revision_id are to be mapped to RevisionID property.
The values from UID are to be mapped to UID property.
Last step is connecting the Teamcenter Create and Update Snap output to the Mapping input.

Snap configuration | Snap output |
|---|---|
![]() | |
7: To write a file the JSON document output of the Mapper Snap needs to be formatted to a binary stream. The JSON document will be read by an Excel Formatter to create the binary stream in the pipeline. Since the Excel sheet shall have a header row and the sheets name shall be 'TeamcenterResult', the appropriate setting in the Snap is done.


8: Last but not least the File Writer Snap is used to store the file ‘Result_OOTB.xlsx’ in directory.


The file including result information is now stored at SnapLogic.

The Teamcenter data for the newly created elements is now visible in the stored file.




