Forum Discussion
sftp file modified date
Hi vladenache,
The approach above will let you retrieve the actual file-level Last modified value. I would add one more step if your end goal is incremental pickup rather than only displaying that timestamp.
A practical pattern is:
- Get the folder child items.
- ForEach file, retrieve its lastModified metadata.
- Compare that value against a persisted watermark representing the last successfully processed timestamp.
- Process only files newer than that watermark.
- Update the watermark only after the pipeline completes successfully.
Alternatively, if the requirement is simply to copy files modified after a known timestamp, the Fabric SFTP Copy activity already supports Filter by last modified. You can provide a UTC Start time so that only files whose modified timestamp is greater than or equal to that value are selected.
I would avoid using utcNow() as the watermark at the start of every run, because a failed or long-running pipeline could then create gaps. Persisting the maximum successfully processed lastModified value is generally safer.
Also keep in mind that childItems itself only returns the child item name/type, so you still need the second Get Metadata activity if you specifically want each individual file's lastModified value.
AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.