Mapping Custom Site and Tag Codes

You may need to import data in which sites and tags are identified with external codes. In this case, you can create mappings between external codes, and identification details used in the database by using attributes to store the external codes.

Mapping Site Codes

If you use external site codes in your imported data, you can map these to specific sites by storing the site codes in a custom attribute that belongs to the site object.

To map imported site codes with an attribute:

  1. In the Attribute Types module, create an attribute to store the custom site code and apply it to the appropriate object types. See Creating an Attribute Type for details of how to do this.
  2. For each site object that you want to map, enter the external site code as the attribute value for that site.
  3. In the Data Import module, create an import configuration and add a Data Column with the type Site Code.
  4. In the Column Specification dialog, choose the attribute in which the site codes are stored.

When you run the data import, the site code identifies the site to which the imported data will be written.

Note:

There is no restriction on the number of site code attributes you can create. If you are importing data from different sources, you can configure a separate site code attribute for each source.

Mapping tag names to custom tag codes with an attribute

If you use external tag codes in your imported data, you can map these to tag names by using a custom attribute to store mappings from the external tag code to the internal tag name.

Note:

Because the mapping is to the tag name, which is not unique, you must also provide a column to identify the site.

To map imported tag codes with an attribute:

  1. In the Attribute Types module, create an enumerated attribute to store the tag code mappings. See Creating an Attribute Type for details of how to do this. You do not have to apply the attribute to any objects, it is just used to look up the stored mappings.
  2. Create an attribute value for each tag that you want to map.In the Inserting Values dialog, enter the tag name in the Description field, and the external tag code in the Value field. See Adding Attribute Values to a List for details of how to add values to an enumerated attribute.
  3. In the Data Import module, create an import configuration
  4. Add a Data Column with the type Tag Value and choose the Read tag Id or name from another column option. This is the column that holds the data.
  5. Add a Data Column with the type Mapping tag name attribute and choose the attribute in which you stored the tag code mappings. This is the column that holds the external tag code.
  6. Add a Data Column with the type Site Name, Site ID or Site Code as described above. This is the column that holds the site identifier.

When you run the data import, the tag code is mapped to the internal tag name and, together with the site information, is used to identify which tag the data is written to.

Note:

There is no restriction on the number of tag code attributes you can create. If you are importing data from different sources, you can configure a separate tag code attribute for each source.




Help for SPM, version 3.4. Topic updated: 17 November 2017. Help published: 14 June 2019