Exporting CSV file with Date and Time in the file name

You’re telling the script to use a literal value for site and location by putting something in quotes. Instead, you want to tell it to use the value of the tag.

You probably hit the tag icon off to the right of the scripting area and chose your tag. While that seems like the right thing to do, especially when you choose “value” for that tag, it doesn’t work (as you found out). Instead, take the string it gave you ("[Client]Customer"), and use that as the argument for system.tag.read()

Remember that system.tag.read() gives you a Python tuple, with both the value and the quality. So you would ultimately want something like:

location = system.tag.read("[Client]Site").value

To make it more robust, you can add checks for good quality, make sure the tag value has only valid filename characters, etc. But this will get you going.

[edit]
Thanks, Adam, for beating me to it by a hair! :smiley: