AnsweredAssumed Answered

PI UFL Connector Init File Format String "\"

Question asked by PedroCampos on Aug 6, 2019

I need to create tags according to json Databases crawler information from https://<piserver>/piwebapi/search/sources. I am using PI Connector UFL pointing to piwebapi to get the information. The "Name" is retrieved on format "\\AFServer\Database" I would like to create tags for each database to monitor LastCrawled time writing into a tag. Isn't possible to create tags with "\\" or "\". On the UFL Connector Init File, I would like to replace "\\" with "" and replace "\" with "." but isn't possible.

 

[FIELD]
FIELD(1).NAME="TagName"
FIELD(4).NAME="TagVal"
FIELD(4).TYPE="String"

 

[MSG]
MSG(1).NAME="Data"

 

[Data]
Data.FILTER=C1=="*"

FOREACH (JsonGetItem(__MESSAGE, "Items[]")) DO
   TagName = JsonGetValue(__ITEM, "Name")
   TagName = Replace(TagName, "\\", " ")
   TagName = Replace(TagName, "\", ".")
   Print(TagName)
   TagVal = JsonGetValue(__ITEM, "LastCrawl")
   Print(TagVal)
   StoreInPI(TagName, ,NOW(), TagVal)
ENDFOR

Outcomes