Was given a CSV file with two columns. 1st column is a list of tag paths where a custom property is to be changed. 2nd column is what we need to change that custom property's value too.
example:
col1(key): folder1/folder2/folder3/tag.customPropertyName
col2(Value): {site}.{service}::{another parameter}
I got the value in the customer property to change. The issue is ignition does not automatically update the parameters.
Here is what we found out so far:
- if we go into the customer parameter and add any char, like a space, apply. then go back in delete that char. apply again. The parameter will then take effect.
- when we exported the tags. We noticed that the tags we changed manually had a bindType: "parameter" part in the dictionary output but the rest we did not manually change did not have this.
I used the dictionary scrip below to change the values.
Is there a better way to do this, like should I use system.tag.configure instead?
> import csv
> # file path TODO: make dynamic
> path = r"C:\Users\UpdateTags_tagEdit.csv"
>
> # Variables
> path_ig = {}
>
> # Read in CSV file :
> with open(path, mode='r') as tags:
> readin = csv.reader(tags, delimiter=",")
> for cols in readin:
> path_ig[cols [1]] = cols [2]
> for key,value in path_ig.items():
> # Update .customProperty description for each tag
> system.tag.writeBlocking(path_ig.keys(),path_ig.values())