The best solution I can think of is to create an AF Table linking to the table of PI OLEDB Enterprise that stores all the name of the elements in the database. Please, use the query below:
SELECT Name FROM [Database Name].[Asset].[Element]
Then, choose the Table Lookup Data Reference pointing to this new table using the query below in the Configuration String of the attribute that would store the name of the element:
SELECT Name FROM ElementNames WHERE Name = '%Element%'
In order to improve the performance, you can copy and paste the result of the first query on a new AF Table. In this case, the AF Table wouldn’t be linked to the tables of the PI OLEDB Enterprise, improving the performance. The down side of this option is that you need to add a new entry every time a new element is created.
Another option would be to develop a custom data reference that would return the name of the element of the chosen attribute.
I'm not sure I understand the question, but the ERD current element can be accessed as E.ElementName or E.ElementPath. There's also a way to do this in the GUI if you look for a check box or two near the bottom of the screen.
Thanks David and Marcos. There is a checkbox to add element name. My apologies for the question.