want the file that has today's date on it. Example:
abcd_20171013
adcd_20171012
I want to import the first file.
thanks!
Solved! Go to Solution.
You'll want to use a formula like the following:
"abcd_"+ToString(DateTimeFormat(DateTimeToday(),"%Y%m%d"))
This will put today's date in 20171013 format, convert it to string, then add it to whatever your base file name is called. If you're using this file as an input, you can feed this file name into a Dynamic Input tool to bring in that specific file. By adding the full file path to the "abcd_" text, you'll be able to choose the option in Dynamic Input to replace full filepath with this field to always bring in the current day's file.
Hope that helps!
NJ
Ok, thanks. I'll see if I can figure out what that means and try it. Basically, I don't care what is to the left of the date as far as file name goes. Was thinking that could be wild carded out. The date will be at the far right. That, I need to catch as today's date and import it. The path will always be the same and the file name to the left of the date could probably always be the same if I made sure of that before running the workflow. I've never used that tool. I was thinking this could all be placed in the file name with wild card formula in the Input tool file name field. Thanks for your help.
I guess I don't understand why it couldn't be: "C:\adcd"+ToString(DateTimeFormat(DateTimeToday(),"%Y%m%d")) in the file name in the Input tool. I'll try and figure it out tomorrow. Frustrating. Thanks again.
If you are using a Directory tool (or even if you just have a straight list of the file names/file paths) you could use a Filter tool with a custom expression:
Right([filename], 8) = datetimeformat(datetimetoday(),'%Y%m%d')
You might need some additional logic if your filename/path contains the file extension:
Right([filename], 13) = datetimeformat(datetimetoday(),'%Y%m%d') +'.xlsx'
Either way I think the Dynamic Input tool is the way to go!
The filter custom doesnot work for me ,,,
i have four files region_20190617, region_20190618,region_20190619,region_20190620. When I try
Right([filename], 13) = datetimeformat(datetimetoday(),'%Y%m%d') +'.xlsx' it filter all as false.
but when i try
Right([filename], 13) = '20190618.xlsx' it filter correctly as true.
what am i missing .
@PoojaSingh88 - have you tried to use a formula tool and the expression to make sure it's producing what you expect?
I was able to correct the formula, capital [FileName] worked.However when i tr to pass that into a dynamic input i get an error - Unable to open file for read ...Error opening File.access is denied
User | Count |
---|---|
17 | |
15 | |
15 | |
8 | |
5 |