Community forum

Please note that VisualCron support is not actively monitoring this community forum. Please use our contact page for contacting the VisualCron support directly.


BobJ
  •  BobJ
  • Paid support Topic Starter
2023-02-10T15:54:13Z
I created a list task to identify files in a specific network location. I establish a loop and in the next task, I attempt to set a user variable based on the individual files identified from the list task. I'm trying to determine the modified date on each of the files from the list, but my attempts at using this formula in the variable value fail referencing "file does not exist":

{file[(ModifiedTime|{loop(CurrentValueX)}|yyyy-MM-dd HH:mm:ss)}

I assume the task is using the system account (which is not a domain account with access to the file) and why it can't find the file. I don't see any option to provide credentials when attempting to create a user variable.
Sponsor
Forum information
Joey S
2023-02-20T19:45:52Z
Confused...

How can you list out files that you do not have access to?

I would suggest creating this job locally to test it. I did so using c:\temp on a server and these tasks (sorry...can't paste pics for some reason)
Task #1 - List File task
No credential, set the folder to c:\temp and file mask = * ( I am assuming you have files in C:\temp and are using Windows)

Task #2 - Write file task
Write list of file modified dates to log
file path = wherever you want that is not c:\temp
value = {FILE(ModifiedTime|{LOOP(CurrentValueX)}|yyyy-MM-dd HH:mm:ss)}

Loop
just task #2
For each row x in {TASK(PrevTask|StdOut)}
defaults for everything else

When I did this I received a list of 10 modified date stamps as I had 10 files in c:\temp

I suggest two things after you prove out your local test...Make sure the user accessing the network location has access to the folder path. If you have access just put yourself in for testing and take yourself out after you get a user created. We have users like 'visualcron_serv' to access network folders.
Remember that No Credential = The server name and no user

Number two...you have a lot of lower case in your example. Probably will not help you to do that

in this statement
"{file[(ModifiedTime|{loop(CurrentValueX)}|yyyy-MM-dd HH:mm:ss)}"
both "file" and "loop" are lower case. You should fix that...I don't think lower case works. I know it does not in my example on my machine

If I make "file" lower case my result is
{file(ModifiedTime|c:\temp\filename|yyyy-MM-dd HH:mm:ss)}

If I make "loop" lower case
Error in argument|yyyy-MM-dd HH:mm:ss)}

If I make them both lower case
{file(ModifiedTime|{loop(CurrentValueX)}|yyyy-MM-dd HH:mm:ss)}

With both set to upper case and access to the folder
I get results like this
2022-09-16 08:44:44

Scroll to Top