Hello All,
there are two files in a directory. Both of the files have dynamic input name in the format TSE082QT_DD_MM_YYYY_HHMM and Outstanding_TSE082QT_DD_MM_YYYY_HHMM. So TSE082QT_DD_MM_YYYY_HHMM will always exist, but outstanding_TSE082QT_DD_MM_YYYY_HHMM may or may not exist. So basically, if Outstanding_TSE082QT_DD_MM_YYYY_HHMM exist , the it should get appended to the TSE082QT_DD_MM_YYYY_HHMM.
I have tried to code to check if outstanding_TSE082QT_DD_MM_YYYY_HHMM exist in the directory Exist.
Can somebody please help me on how i can input that file if it exist.
Solved! Go to Solution.
Hi @nazuk
You'll want to do something like this using the directory tool, filter tool, and dynamic input tool 🙂
Hi @nazuk,
I see a couple of options here. If it's guaranteed that only two files are in the folder, you could use wildcards for the whole data type.
C:\path\*.xlsx
If you have more than those two file in the folder, you could use:
C:\path\*TSE082QT*.xlsx
If you want to be even more flexible, you could use a Directory Tool, a Filter Function and the Dynamic Input.
Let me know if this helps.
Best
Alex
Thanks for the quick response. CAn you please help me in getting the formula for file name, since not neccesarily, it will be today's date, it can be any date and any time. Just the keyword will be same.
@grossal : Thanks for the reply.
So basically i want to use first option, since one of the file will have dynamic worksheet name too.
So basically i am using directory tool, then i have applied filter, but then can i directly use dynamic input tool after filter, or do i need to write a formula first to specify file name?
If yes, can you help me with a general formal as how we specify a file name?
Hi @nazuk,
I have just tested it. It worked without specifying the sheet name.
File 1) 25 Rows (Sheet1)
File 2) 6 Rows (Sheet1)
File 3) 6 Rows (changed sheet name to 'custom')
-> 37 total rows.
Make sure to set "Field" to "FullPath" and Action to "Change Entire File Path".
Best
Alex
@grossal : Attaching files
Thanks for the files.
I'd go with a simple attempt:
Obviously this workflow will fail if the outstanding file does not exist, but we still get the result we want. If it does exist, it will append the data, if it doesn't exist, nothing will happen and the workflow fails.
Alex
This is not working, i am still getting error in case one file not exist and that is not that i have to write as an output. just have to append in my first file and use it for next part of the report