Generate raw attribute property mappings for export - SmartPlant Foundation - IM Update 48 - Help - Hexagon

SmartPlant Foundation Help

Language
English
Product
SmartPlant Foundation
Search by Category
Help
SmartPlant Foundation / SDx Version
10
SmartPlant Markup Plus Version
10.0 (2019)
Smart Review Version
2020 (15.0)

After you have created a raw attribute map in the Raw Attribute Map dialog box, you can generate raw attribute property mappings to export the raw attribute properties from an existing CSV inverted format file to a target system or by creating computed columns for properties.

The Ignore Property allows you to ignore the desired properties being loaded into the staging system when importing the data from an existing inverted CSV file. However, you can import the value for the selected property from the inverted CSV file to the staging system by creating a computed column for this property. For more information, refer to Use the Computed column.

When creating computed columns for the properties, apply the InvertedFilter function to check that the property name in the inverted CSV file matches the property name in the computed column. The computed column containing the property is evaluated, and the property value is then imported into the staging system.

To generate the raw attribute property mappings for export:

  1. Click Generate Raw Attribute Properties for Export on the Raw Attribute Map dialog box located under the Column Headers pane in Import Mapping. The Generate Raw Attribute Properties for Export wizard opens.

  2. In the Select CSV File pane, browse to the CSV inverted format file that contains the raw attribute property names. The path to the CSV file is displayed in the CSV File box, and the number of properties read from the CSV file are shown.

    Properties read from the CSV file have all illegal characters removed automatically on selection, such as space, (, ), and /. These are excluded due to property name constraints.

  3. Click Next to open the Review Properties pane, where you can review the property mappings to be created in two tabs:

    • Properties - Lists the number of properties read from the CSV file that generates a raw attribute property mapping.

    • Properties not found in Target System - Lists the number of properties read from the CSV file that do not have a raw attribute property mapping and are not found in the target system.

  4. On the Properties tab, select the Ignore Property check box for the properties you want to ignore when importing the data from an existing CSV file.

    ignore1

    If you use the InvertedFilter computed column to check property names in the input CSV file, ensure that the Ignore Property check box is selected for those property names, to avoid duplicate entries in the staging system and validation errors.

  5. On the Properties not found in the Target System tab, type the name of the target system property to map to the raw attribute property in the box in the Name of Property in Target System to map to column.

  6. When all the target system properties have been entered, click Process.

    • A warning message displays if any entered property names do not exist in the target system. You can modify the existing entry, or continue to create the property mapping. If you continue to create a property mapping with a target system property that does not exist, the raw attribute property mapping is still created. However, the property must be created in the target system to use the export functionality.

    • If a target system property name contains any illegal characters, a warning message is displayed when you click Process. You cannot proceed without removing the illegal characters.

  7. In the Results pane, each of the raw attribute property mappings for export generated is displayed with Success in the Result Details column and a green checkmark in the Has Created column. Click Close.

You can check that the raw attribute property mappings for export have been created in Export Mapping. From there you can also modify or update them as required. For more information, see Stage property to target property mappings.

InvertedFilter

This function checks for the property name in the inverted CSV file and if it matches the property name configured in the computed column, the property values are displayed in the output based on the functions defined in the computed column.

Problem

You can use the Computed API for columns in Inverted CSV formatted file, but duplicate entries are created in the staging system.

Solution

Create a computed column for a property by applying the InvertedFilter function to check if the property name in the inverted CSV file matches the property name configured in the computed column. If they match, the property values are displayed in the output based on the functions defined in the computed column.

Ensure that the Ignore Property check box is selected for the property names. Otherwise, duplicate entries will persist in the staging system and may result in validation errors.

Example

You want to convert the input value dd-MM-yyyy in an inverted CSV file with a DateTime column to an invariant date and time format "yyyy/MM/dd-HH:mm:ss:fff"’. Type the function as follows:

func.InvertedFilter ([PROPERTY_NAME], {"DateTime", func.DateTimeColumn([PROPERTY_VALUE], "dd-MM-yyyy", "UTC")})

The above computed API function checks for the property name “DateTime” in the inverted CSV file. If it matches the column name defined in the computed API, it is displayed as the DateTime column value yyyy/MM/dd-HH:mm:ss:fff.