system.tag.queryTagHistory question

We have the below script in the event handle of a button:

paths = event.source.parent.selectedLocation
startDate = event.source.parent.getComponent(‘Date Range’).startDate
endDate = event.source.parent.getComponent(‘Date Range’).endDate
query = system.tag.queryTagHistory(paths, startDate, endDate)
event.source.parent.query = query

which generates following error : Illegal character ‘[’ (Line 1 , Char 1)

When we replace the ‘query = system.tag.queryTagHistory(paths, startDate, endDate)’
with ’ query = [‘path/to/tag’]’ it runs fine.

am I doing something wrong in the syntax for the ‘query’ not to be dynamic?

Thanks

Yes, the paths for the system.tag.queryTagHistory function must be a list. You are probably sending in a string since you are getting it from the selectedLocation property on the screen. You need to make a list out of it. If the selectedLocation property is a string with comma separated values you will need to split it into a list like this:paths = event.source.parent.selectedLocation.split(",") startDate = event.source.parent.getComponent('Date Range').startDate endDate = event.source.parent.getComponent('Date Range').endDate query = system.tag.queryTagHistory(paths, startDate, endDate) event.source.parent.query = query