Dear Experts,
Need a quick help!
I have a workflow which pull data [ thru dynamic input] from 40 different excel files from a shared drive [NAS location]. It was running fine.
Today I noticed, workflow stopped as one country file was being opened by someone while workflow was running. I had this problem [file was opened] in past, that time workflow ignores that country file but flow executes successfully by bringing data from 39 other country files.
But today it stopped once the alteryx flow reaches that perticular country file. Not sure why?
Any suggestion how to improvise this?
My plan is to run the flow, if a country file has error [if file was opened or due to any other reason], ignore that file but execute the flow with rest.
Here is the image of the detail flow and error. Looking forward the help from the community.
Thanks
Mahabir
Solved! Go to Solution.
Hello @Mahabirpanigrahi ,
one solution could be to do a copy of your data prior to the workflow execution (using the RunCommand tool) and to delete those files after. Even one file is open and locked, it seems that Windows allow the copy.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you @WilliamR for reply. Is that only sollution ?
My data is really heavy, coping to different location will impact my performance. So just thinking there must be some other sollution.
Thanks
Mahabir.
Create a batch macro to read the input files one by one.
You could use a windows command script with the Run Command tool to detect if a file is locked or not, output the list and load those files with the dynamic input. I have tested a batch macro but, for me, the macro output the error.
You will find a good starting point for the command script here: https://www.dostips.com/forum/viewtopic.php?t=5542
If you are a python expert, you can also use the python tool to check, easy to implement than the command script.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello,
I may have what you need. I made a "community" version in attached file.
Parse_Logs_Vtom.yxmd
1 - Get list file from a directory and create a file list "filelist.csv".
2 - Call the macro macro_locked_file.yxmc.
3 - Filter all locked files.
4 - You can add dynamic input after the filter.
macro_locked_file.yxmc
1 - Parameters :
filelist : The file list.
result file : Result output file
2 - Call the powershell script checkLockedFile.ps1 which check if a file is locked or not.
You can test it by opening a log file in ./logs with MS Word.
😉
Hi @sraynal ,
This is so far the best solution I have seen in the community. In the past a few days, I have been getting troubled with Run Command to check file lock status. I used a different approach, also referenced from another thread in the community, like
"@echo off"+"
"
+"2>nul ("+"
"
+" >>"+'"'+[File]+'"'+" echo off"+"
"
+") && (echo File is not locked.>FileStatusCheck.txt) || (echo File is locked!>FileStatusCheck.txt) "
This works as a single process. However, it failed when I added the macro to the application I built and could not figure out the root cause. It always says:
Error: FileStatusCheck (1001): Record #1: Tool #2: The external program ".\FileStatusCheck.bat" returned an error code: 1
Now it's working by using your design. This is really great. Please accept my sincere appreciation!
PS. I just have no idea of the language in the PS1 file. 😄
This solution saved me.
Many other approaches I tried did not work, and also this solution works even if the files are in a folder I have no grant access to edit files.
Awesome!
Thanks a lot!