but what this does is, it looks at the latest date modified that the file was uploaded, of which I want it to look at the actually date on the naming of the file.
In that case, don’t use the Last Modified date. Instead, extract the date from the file name (e.g., MDP_Payment receipt_15th July 2026), convert it to a DateTime, and use that value to identify the latest file. Since your naming convention is consistent, this approach will be more reliable.
The requirement is to process files based on the date embedded in the filename rather than the file’s Created or Modified date, then extracting the date from the filename is the correct approach. File format can be picked from config file/Assets.
That’s not how I read it, but yeah they can do it that way too if that’s really what they want. But again, that’s a point of failure. I’m guessing the actual file creation date always matches what’s in the filename, so it would be better to use the file property than the filename pattern.
If you’re not looking for the last modified file and instead want to retrieve the file based on its creation time, simply replace “LastWriteTime” with “CreationTime” in your expression.