** Added warning**
I was pointed out that the usage of PV.utils is not documented in the extensibility docs and thus may fall outside of what is supported within the extensibility framework. To see this guideline, please see this section of the extensibility docs:
PI Vision 2020 brought a change to how paths are encoded, the change is great as it makes the display more resilient to changes to the AF structure. But, this impact custom symbols such as manual data entry symbols. Let's see what is the current situation and how we can resolve it.
Here is how a path is stored in PI Vision 2020, with additional IDs for the element and the attribute itself. These IDs are randomly generated GUIDs guaranteed to be unique on your AF server. Note this isn't enough information to create a Full WebID as that would require the ID of everything in the path.
pathComponents = scope.symbol.DataSources
As you can see there is only two GUID, thus it wouldn't be too hard to remove them by simply looking at the placements of the question marks in the path. But PV comes with utilities to help you parse this path with the PV.Utils object.
"sortId": "piserver\\nugreen\\nugreen\\houston\\cracking process|feedrate?98264fae-08e0-5a52-18be-0ca9962364ff",
"fullPath": "\\\\piserver\\NuGreen\\NuGreen\\Houston\\Cracking Process|Feedrate?98264fae-08e0-5a52-18be-0ca9962364ff",
"label": "Cracking Process|Feedrate?98264fae-08e0-5a52-18be-0ca9962364ff",
Using this, we can start to rebuild a path as you would have in previous versions of PI Vision which I do in the next few lines.
path = pathCompontent.scheme + ":" + PV.Utils.removePersistId(pathCompontent.fullPath)
Similarly you can build a path or webid 2.0 that you can use in PI Web API.