If you look closely, the error happens at Source: Assign my file to display it
If you look at the activity with this name, you will see a simple assign an Array element to a string variable MyFile:
Now, the error says: Index was out of range
So this would mean that the index 0 of our array Newest_File_Check has no value. Because it is the index of the first element of the array, it means that the array is empty.
We can therefore conclude that the search did not return any results and the array is empty.
Do you have any files in the folder and is the path to the folder correct?
In this case, I would suggest checking the string in your search function: directory.GetFiles("*usb201807101424_ポリシーIDなし_完全一致_20180711.csv").Where(function(file) file.LastWriteTime.Date= DateTime.Now.Date).OrderByDescending(function(d) d.LastWriteTimeUtc).ToArray
Maybe make it more broad as a test? directory.GetFiles("*.csv").Where(function(file) file.LastWriteTime.Date= DateTime.Now.Date).OrderByDescending(function(d) d.LastWriteTimeUtc).ToArray
I have tried to create another files and folder but using the same function (just changed the file/path name}
and the same message of workflow exception appeared.
Yes, indeed. I looked closer at the function and the issue is here: .Where(function(file) file.LastWriteTime.Date= DateTime.Now.Date)
This bit will only return you a list of files that were modified today
This means that you will not get the files from your current folder, as those were modified 20 days ago.
Try a simple fix: .Where(function(file) file.LastWriteTime.Date<= DateTime.Now.Date)
I had using Data Scraping function to extract the data from website.
Could you advise on how can i open the extract structured Data table by CSV or Excel?
I have checked the security/access permission of the folder itself and no found any restriction.
May I know why this is happened?Below screenshot is the Write CSV activity that i have made.
Maybe running the studio with administrator privileges would help here? Assuming it is the system that blocks a save activity. Maybe try to save as a test on your desktop.
The same Workflow exception is appeared even though i saved the folder to desktop or D drive.
Do you happened to receive or face the similar issue like mine?
Folder security level also has been changed as administrator privilege.