Mapping a URL Database Attribute
- Last UpdatedMar 27, 2024
- 3 minute read
In this example, a mapping will be set up for the URL Database Attribute of a SCDIAG (diagram) Database Attribute using the XPath Expression Builder.
This scenario assumes that the original intelligent P&ID Diagrams from which import files are generated are subsequently stored in a SharePoint Portal site.
An attribute mapping will be constructed which uses an XPath expression to add both the Sharepoint location and the correct file suffix to the import file’s diagram name Source Attribute value. This is then written to the URL attribute of the corresponding SCDIAG element, thereby providing a link from the schematic database directly to the original intelligent P&ID file (in this example an AVEVA P&ID Diagram (.DWG)).
-
Using the Attribute Mappings dialog, create a new mapping and name it appropriately.

In the Element Types field, select the SCDIAGRAM (diagram) element.
From the Database Attribute field, select the URL attribute.
Leave the Condition field blank.
For further information, refer to Create Attribute Mappings.
-
Click on the ... option in the Source Attribute field.

The XPath Expression Builder dialog is then displayed, with the SCDIAGRAM element listed in the Source Dictionary pane.

-
Double-click on the Concatenate operator on the Shortcuts tab.

The operator is then displayed in the Expression pane.

-
Between the first parenthesis and the comma in the concat operator, enter the URL of the drawing location (excluding the file name) in double quotes.

-
Place the cursor after the comma and then double-click on the Name attribute of the SCDIAGRAM element. The Name attribute is then placed into the expression.

-
After the second comma (which is added when the Name attribute is selected), enter the file extension of the source drawing.

-
The expression is now complete. Select the OK option then save it and close the dialog. The expression is displayed in the Source Attribute field of the main Attribute Mappings dialog.

-
When SCDIAGRAM elements are imported into the database, their URL attributes are automatically populated using the XPath expression.

