Get Date modified for XML file


I have a workflow where I put for each file in certain directory. There I have few files and I only have to get the “Date modified” for xml file. When I set TypeArgument to XDocument it says that Get.LastWriteTime is not a member

Hi, check if the below function works

Nope, it shows the same error

What type is your file? It should be string.


1 Like

I have different files in a folder and I have to get date modified only for the XML file

I mean “file” variable you use in ForEach…
See the picture

then how do I get it only for xml file if type is string?

The method “Directory.GetFiles(…)” returns in array of string file names.
Therefore “file” should be also string type variable.
It has nothing to do with what “file names” will be selected.

The other likely problem is confusion of “file” variable and “file” class

Better use different name for the variable, e.g. “f”


Try below once