Filetime can only return one value. And a variable can also have only one value. The wildcard can match more than one file so that's not valid. Either use the exact file name or create a loop that loops through the files and return the filetime for each file. See this blog post: Loops in the Script
bad news for me!
so in my case, if I have just this one file in the folder (every day the yesterday's one get deleted and the new one is deposited), I would need to:
- create a for each so to loop through that one file (!!)
For each vFileName in Filelist ('\\location\drive$\folder\*.xls') Load '$(vFileName)' as FileName From [$(vFileName)]; Next vFileName
- then load that in a variable
Let vStock = FileName()
would it be something like this?
I am trying this on a dummy dashboard in the meantime and, to be honest, I have couple files in the same folder
So I did
For each vFileName in Filelist ('\\location\drive$\folder\*.xls') Let vStock = FileTime('$(vFileName)'); Next For each vFileName2 in Filelist ('\\location\drive$\folder\*.csv') Let vStock2 = FileTime('$(vFileName2)'); Next
but it is not working properly.
The right file names are stored into vFilaName and vFileName2, but the FileTime function for some reason is working just for the first file.
So, vStock has the timestamp, meanwhile vStock2 is generated empty.
Am I doing something wrong here?
thank you very much!